summaryrefslogtreecommitdiff
path: root/src/gui/equipmentwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-06-05 04:45:51 +0300
committerAndrei Karas <akaras@inbox.ru>2011-06-05 04:45:51 +0300
commit93aa9c81a2043c6caecd8437bfecbfa0c9b79436 (patch)
tree3438b31a08a3d5ec673f439c1cbc8fd7bd5ae59a /src/gui/equipmentwindow.cpp
parent6d06bec226e4d6966e62612b41baf336955b23f4 (diff)
downloadplus-93aa9c81a2043c6caecd8437bfecbfa0c9b79436.tar.gz
plus-93aa9c81a2043c6caecd8437bfecbfa0c9b79436.tar.bz2
plus-93aa9c81a2043c6caecd8437bfecbfa0c9b79436.tar.xz
plus-93aa9c81a2043c6caecd8437bfecbfa0c9b79436.zip
Fix memory leak in equipmentwindow and socialwindow.
Diffstat (limited to 'src/gui/equipmentwindow.cpp')
-rw-r--r--src/gui/equipmentwindow.cpp11
1 files changed, 9 insertions, 2 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)