diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-13 01:49:50 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-13 01:49:50 (GMT) |
commit | c6099d777d844699fb8a4243921159898bc4f45c (patch) | |
tree | 3955299c2b11f4fe3f6b822460d5f154fd4f8d28 | |
parent | 5b7bde2ffbac62f75cb8539f5ab43bb5f4274eae (diff) | |
download | fluxbox_pavel-c6099d777d844699fb8a4243921159898bc4f45c.zip fluxbox_pavel-c6099d777d844699fb8a4243921159898bc4f45c.tar.bz2 |
fix crashes on restart
-rw-r--r-- | src/Toolbar.cc | 3 | ||||
-rw-r--r-- | src/fluxbox.cc | 15 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 89ba9cf..18f07fc 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc | |||
@@ -287,7 +287,8 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width): | |||
287 | } | 287 | } |
288 | 288 | ||
289 | Toolbar::~Toolbar() { | 289 | Toolbar::~Toolbar() { |
290 | Fluxbox::instance()->keys()->unregisterWindow(window().window()); | 290 | if (Fluxbox::instance()->keys()) |
291 | Fluxbox::instance()->keys()->unregisterWindow(window().window()); | ||
291 | FbTk::EventManager::instance()->remove(window()); | 292 | FbTk::EventManager::instance()->remove(window()); |
292 | // remove menu items before we delete tools so we dont end up | 293 | // remove menu items before we delete tools so we dont end up |
293 | // with dangling pointers to old submenu items (internal menus) | 294 | // with dangling pointers to old submenu items (internal menus) |
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 110123c..d45a45e 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -420,14 +420,6 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile | |||
420 | 420 | ||
421 | Fluxbox::~Fluxbox() { | 421 | Fluxbox::~Fluxbox() { |
422 | 422 | ||
423 | // destroy atomhandlers | ||
424 | for (AtomHandlerContainerIt it= m_atomhandler.begin(); | ||
425 | it != m_atomhandler.end(); | ||
426 | it++) { | ||
427 | delete (*it).first; | ||
428 | } | ||
429 | m_atomhandler.clear(); | ||
430 | |||
431 | // this needs to be destroyed before screens; otherwise, menus stored in | 423 | // this needs to be destroyed before screens; otherwise, menus stored in |
432 | // key commands cause a segfault when the XLayerItem is destroyed | 424 | // key commands cause a segfault when the XLayerItem is destroyed |
433 | m_key.reset(0); | 425 | m_key.reset(0); |
@@ -438,6 +430,13 @@ Fluxbox::~Fluxbox() { | |||
438 | m_screen_list.pop_back(); | 430 | m_screen_list.pop_back(); |
439 | } | 431 | } |
440 | 432 | ||
433 | // destroy atomhandlers | ||
434 | for (AtomHandlerContainerIt it= m_atomhandler.begin(); | ||
435 | it != m_atomhandler.end(); | ||
436 | it++) { | ||
437 | delete (*it).first; | ||
438 | } | ||
439 | m_atomhandler.clear(); | ||
441 | 440 | ||
442 | clearMenuFilenames(); | 441 | clearMenuFilenames(); |
443 | } | 442 | } |