fix crashes on restart
This commit is contained in:
parent
5b7bde2ffb
commit
c6099d777d
2 changed files with 9 additions and 9 deletions
|
@ -287,7 +287,8 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width):
|
|||
}
|
||||
|
||||
Toolbar::~Toolbar() {
|
||||
Fluxbox::instance()->keys()->unregisterWindow(window().window());
|
||||
if (Fluxbox::instance()->keys())
|
||||
Fluxbox::instance()->keys()->unregisterWindow(window().window());
|
||||
FbTk::EventManager::instance()->remove(window());
|
||||
// remove menu items before we delete tools so we dont end up
|
||||
// with dangling pointers to old submenu items (internal menus)
|
||||
|
|
|
@ -420,14 +420,6 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
|
|||
|
||||
Fluxbox::~Fluxbox() {
|
||||
|
||||
// destroy atomhandlers
|
||||
for (AtomHandlerContainerIt it= m_atomhandler.begin();
|
||||
it != m_atomhandler.end();
|
||||
it++) {
|
||||
delete (*it).first;
|
||||
}
|
||||
m_atomhandler.clear();
|
||||
|
||||
// this needs to be destroyed before screens; otherwise, menus stored in
|
||||
// key commands cause a segfault when the XLayerItem is destroyed
|
||||
m_key.reset(0);
|
||||
|
@ -438,6 +430,13 @@ Fluxbox::~Fluxbox() {
|
|||
m_screen_list.pop_back();
|
||||
}
|
||||
|
||||
// destroy atomhandlers
|
||||
for (AtomHandlerContainerIt it= m_atomhandler.begin();
|
||||
it != m_atomhandler.end();
|
||||
it++) {
|
||||
delete (*it).first;
|
||||
}
|
||||
m_atomhandler.clear();
|
||||
|
||||
clearMenuFilenames();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue