diff options
author | simonb <simonb> | 2006-04-24 13:34:14 (GMT) |
---|---|---|
committer | simonb <simonb> | 2006-04-24 13:34:14 (GMT) |
commit | f6a072430d4de159e229d6172adc5ba5ae985512 (patch) | |
tree | e87832fba92188131c4e9441b72c0e9c03666660 /src/FbTk | |
parent | 731f0deaafff3a4fe4353bbfc421a5dc3d5a2337 (diff) | |
download | fluxbox_pavel-f6a072430d4de159e229d6172adc5ba5ae985512.zip fluxbox_pavel-f6a072430d4de159e229d6172adc5ba5ae985512.tar.bz2 |
fix memory leaks in menu code
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/Menu.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 4775ae9..b08bfe9 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc | |||
@@ -232,14 +232,16 @@ int Menu::remove(unsigned int index) { | |||
232 | if (item) { | 232 | if (item) { |
233 | menuitems.erase(it); | 233 | menuitems.erase(it); |
234 | 234 | ||
235 | if (!m_internal_menu && item->submenu() != 0) { | 235 | if (item->submenu() != 0) { |
236 | Menu *tmp = item->submenu(); | 236 | Menu *tmp = item->submenu(); |
237 | // if menu is interal we should just hide it instead | 237 | // if menu is internal we should just hide it instead |
238 | // if destroying it | 238 | // if destroying it |
239 | if (! tmp->m_internal_menu) { | 239 | if (! tmp->m_internal_menu) { |
240 | delete tmp; | 240 | delete tmp; |
241 | } else | 241 | } |
242 | tmp->internal_hide(); | 242 | // We can't internal_hide here, as the child may be deleted! |
243 | // } else | ||
244 | // tmp->internal_hide(); | ||
243 | } | 245 | } |
244 | 246 | ||
245 | 247 | ||