aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-06-20 19:50:47 +0200
committersapier <Sapier at GMX dot net>2014-06-20 19:50:47 +0200
commite81454fb387cd98b4a63ade83a9eb41f1bdca278 (patch)
treec132631eea5b70cf828cbba60b4ae6d9bedbaef4 /src
parentef8cdd890cd36b1fde54b44e125edf7603821a53 (diff)
downloadminetest-e81454fb387cd98b4a63ade83a9eb41f1bdca278.tar.gz
minetest-e81454fb387cd98b4a63ade83a9eb41f1bdca278.tar.bz2
minetest-e81454fb387cd98b4a63ade83a9eb41f1bdca278.zip
Fix small memory leaks on shutdown
Diffstat (limited to 'src')
-rw-r--r--src/guiEngine.cpp7
-rw-r--r--src/guiFormSpecMenu.cpp5
-rw-r--r--src/guiTable.cpp2
3 files changed, 10 insertions, 4 deletions
diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp
index 671f0c574..34bdaffad 100644
--- a/src/guiEngine.cpp
+++ b/src/guiEngine.cpp
@@ -205,8 +205,9 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev,
}
m_menu->quitMenu();
- m_menu->drop();
- m_menu = 0;
+ m_menu->remove();
+ delete m_menu;
+ m_menu = NULL;
}
/******************************************************************************/
@@ -279,8 +280,6 @@ GUIEngine::~GUIEngine()
m_sound_manager = NULL;
}
- //TODO: clean up m_menu here
-
infostream<<"GUIEngine: Deinitializing scripting"<<std::endl;
delete m_script;
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp
index f69f1b9a5..6073ed7cc 100644
--- a/src/guiFormSpecMenu.cpp
+++ b/src/guiFormSpecMenu.cpp
@@ -102,6 +102,11 @@ GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,
GUIFormSpecMenu::~GUIFormSpecMenu()
{
removeChildren();
+
+ for (u32 i = 0; i < m_tables.size(); ++i) {
+ GUITable *table = m_tables[i].second;
+ table->drop();
+ }
delete m_selected_item;
diff --git a/src/guiTable.cpp b/src/guiTable.cpp
index 5febb8370..4d6fc1950 100644
--- a/src/guiTable.cpp
+++ b/src/guiTable.cpp
@@ -98,6 +98,8 @@ GUITable::~GUITable()
if (m_font)
m_font->drop();
+
+ m_scrollbar->remove();
}
GUITable::Option GUITable::splitOption(const std::string &str)