summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/equipmentwindow.cpp11
-rw-r--r--src/gui/popupmenu.cpp3
-rw-r--r--src/gui/socialwindow.cpp8
3 files changed, 18 insertions, 4 deletions
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp
index edad33623..92ff782ab 100644
--- a/src/gui/equipmentwindow.cpp
+++ b/src/gui/equipmentwindow.cpp
@@ -120,6 +120,13 @@ EquipmentWindow::~EquipmentWindow()
{
delete mItemPopup;
mItemPopup = 0;
+ if (this == beingEquipmentWindow)
+ {
+ if (mEquipment)
+ delete mEquipment->getBackend();
+ delete mEquipment;
+ mEquipment = 0;
+ }
}
void EquipmentWindow::draw(gcn::Graphics *graphics)
@@ -299,13 +306,13 @@ void EquipmentWindow::setBeing(Being *being)
mBeing = being;
if (!being)
{
+ if (mEquipment)
+ delete mEquipment->getBackend();
delete mEquipment;
mEquipment = 0;
return;
}
mEquipment = being->getEquipment();
- if (!mEquipment)
- return;
}
void EquipmentWindow::updateBeing(Being *being)
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index c3f28744c..a9905d4ca 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -1402,8 +1402,7 @@ void PopupMenu::handleLink(const std::string &link,
}
else
{
- Equipment *eq = being->getEquipment();
- if (eq && beingEquipmentWindow)
+ if (beingEquipmentWindow)
{
beingEquipmentWindow->setBeing(being);
beingEquipmentWindow->setVisible(true);
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index 7b8d064ce..de9bab42b 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -558,6 +558,14 @@ public:
std::list<MapItem*>::iterator i = portals.begin();
SpecialLayer *specialLayer = map->getSpecialLayer();
+ std::vector<Avatar*>::iterator ia = avatars->begin();
+
+ while (ia != avatars->end())
+ {
+ delete *ia;
+ ++ ia;
+ }
+
avatars->clear();
int idx = 0;