aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-01-13 01:49:50 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-01-13 01:49:50 (GMT)
commitc6099d777d844699fb8a4243921159898bc4f45c (patch)
tree3955299c2b11f4fe3f6b822460d5f154fd4f8d28 /src
parent5b7bde2ffbac62f75cb8539f5ab43bb5f4274eae (diff)
downloadfluxbox_paul-c6099d777d844699fb8a4243921159898bc4f45c.zip
fluxbox_paul-c6099d777d844699fb8a4243921159898bc4f45c.tar.bz2
fix crashes on restart
Diffstat (limited to 'src')
-rw-r--r--src/Toolbar.cc3
-rw-r--r--src/fluxbox.cc15
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
289Toolbar::~Toolbar() { 289Toolbar::~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
421Fluxbox::~Fluxbox() { 421Fluxbox::~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}