Skip to content

Commit e81454f

Browse files
sapiersapier
sapier
authored and
sapier
committedJun 20, 2014
Fix small memory leaks on shutdown
1 parent ef8cdd8 commit e81454f

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed
 

Diff for: ‎src/guiEngine.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev,
205205
}
206206

207207
m_menu->quitMenu();
208-
m_menu->drop();
209-
m_menu = 0;
208+
m_menu->remove();
209+
delete m_menu;
210+
m_menu = NULL;
210211
}
211212

212213
/******************************************************************************/
@@ -279,8 +280,6 @@ GUIEngine::~GUIEngine()
279280
m_sound_manager = NULL;
280281
}
281282

282-
//TODO: clean up m_menu here
283-
284283
infostream<<"GUIEngine: Deinitializing scripting"<<std::endl;
285284
delete m_script;
286285

Diff for: ‎src/guiFormSpecMenu.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,
102102
GUIFormSpecMenu::~GUIFormSpecMenu()
103103
{
104104
removeChildren();
105+
106+
for (u32 i = 0; i < m_tables.size(); ++i) {
107+
GUITable *table = m_tables[i].second;
108+
table->drop();
109+
}
105110

106111
delete m_selected_item;
107112

Diff for: ‎src/guiTable.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ GUITable::~GUITable()
9898

9999
if (m_font)
100100
m_font->drop();
101+
102+
m_scrollbar->remove();
101103
}
102104

103105
GUITable::Option GUITable::splitOption(const std::string &str)

0 commit comments

Comments
 (0)
Please sign in to comment.