summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-08-30 21:05:27 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-08-30 21:05:27 +0200
commit4ab9c3f14340910e77856a9e12779ee8c6b9be4d (patch)
tree92bdd158df31b40e18f4251c78e77e153a4a298e
parentaa8a8adb90c17e2a61c5245ea0dc3552ea78794f (diff)
downloadmana-4ab9c3f14340910e77856a9e12779ee8c6b9be4d.tar.gz
mana-4ab9c3f14340910e77856a9e12779ee8c6b9be4d.tar.bz2
mana-4ab9c3f14340910e77856a9e12779ee8c6b9be4d.tar.xz
mana-4ab9c3f14340910e77856a9e12779ee8c6b9be4d.zip
Fixed a memleak in the ManaServ::InventoryHandler()
-rw-r--r--src/net/manaserv/inventoryhandler.cpp5
-rw-r--r--src/net/manaserv/inventoryhandler.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/net/manaserv/inventoryhandler.cpp b/src/net/manaserv/inventoryhandler.cpp
index 94494319..67c79a17 100644
--- a/src/net/manaserv/inventoryhandler.cpp
+++ b/src/net/manaserv/inventoryhandler.cpp
@@ -65,6 +65,11 @@ EquipBackend::EquipBackend()
mVisibleSlots = 0;
}
+EquipBackend::~EquipBackend()
+{
+ clear();
+}
+
Item *EquipBackend::getEquipment(int slotIndex) const
{
Slots::const_iterator it = mSlots.find(slotIndex);
diff --git a/src/net/manaserv/inventoryhandler.h b/src/net/manaserv/inventoryhandler.h
index 1e05b49d..446105ee 100644
--- a/src/net/manaserv/inventoryhandler.h
+++ b/src/net/manaserv/inventoryhandler.h
@@ -38,6 +38,8 @@ class EquipBackend : public Equipment::Backend, public EventListener
public:
EquipBackend();
+ ~EquipBackend();
+
Item *getEquipment(int slotIndex) const;
std::string getSlotName(int slotIndex) const;
void clear();