aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2013-04-09 20:14:07 +0200
committerPilzAdam <pilzadam@minetest.net>2013-05-09 17:08:23 +0200
commitee1155fe6d5683578294c0ea20a8a3a0bf8ecbe4 (patch)
tree0e8600231b83c66cff5492d797f7ad5e6d7dd3b6
parent3b1c3ac678157a1b7b7c17769499bec53868c9a9 (diff)
downloadminetest-ee1155fe6d5683578294c0ea20a8a3a0bf8ecbe4.tar.gz
minetest-ee1155fe6d5683578294c0ea20a8a3a0bf8ecbe4.tar.bz2
minetest-ee1155fe6d5683578294c0ea20a8a3a0bf8ecbe4.zip
Really fix itemdef memory leak
-rw-r--r--src/itemdef.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/itemdef.cpp b/src/itemdef.cpp
index 05328ea48..d660db77f 100644
--- a/src/itemdef.cpp
+++ b/src/itemdef.cpp
@@ -226,17 +226,11 @@ class CItemDefManager: public IWritableItemDefManager
public:
CItemDefManager()
{
- for (std::map<std::string, ItemDefinition*>::iterator iter =
- m_item_definitions.begin(); iter != m_item_definitions.end();
- iter ++) {
- delete iter->second;
- }
- m_item_definitions.clear();
+
#ifndef SERVER
m_main_thread = get_current_thread_id();
m_driver = NULL;
#endif
-
clear();
}
virtual ~CItemDefManager()
@@ -260,6 +254,12 @@ public:
}
m_driver = NULL;
#endif
+ for (std::map<std::string, ItemDefinition*>::iterator iter =
+ m_item_definitions.begin(); iter != m_item_definitions.end();
+ iter ++) {
+ delete iter->second;
+ }
+ m_item_definitions.clear();
}
virtual const ItemDefinition& get(const std::string &name_) const
{