diff options
author | mathias <mathias> | 2004-11-20 18:12:51 (GMT) |
---|---|---|
committer | mathias <mathias> | 2004-11-20 18:12:51 (GMT) |
commit | 19bc596b84b26f6c3022d05973ae514a50eeeea1 (patch) | |
tree | 3e40c2506edefc523c36d304a2580e3b4e00bfb9 | |
parent | e5b5984eca548c13ad82b02d96b6b4a9496d15d4 (diff) | |
download | fluxbox-19bc596b84b26f6c3022d05973ae514a50eeeea1.zip fluxbox-19bc596b84b26f6c3022d05973ae514a50eeeea1.tar.bz2 |
fix segfaults on restart/exit, still issues with former iconified windows
at startup of fluxbox
should close #1067582, #1067580, #1060912
-rw-r--r-- | src/Screen.cc | 26 | ||||
-rw-r--r-- | src/fluxbox.cc | 16 |
2 files changed, 27 insertions, 15 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index da55b7e..9bb0e2d 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -408,9 +408,6 @@ BScreen::~BScreen() { | |||
408 | // we need to destroy it before we destroy workspaces | 408 | // we need to destroy it before we destroy workspaces |
409 | m_workspacemenu.reset(0); | 409 | m_workspacemenu.reset(0); |
410 | 410 | ||
411 | // slit must be destroyed before headAreas (Struts) | ||
412 | m_slit.reset(0); | ||
413 | |||
414 | if (geom_pixmap != None) | 411 | if (geom_pixmap != None) |
415 | imageControl().removeImage(geom_pixmap); | 412 | imageControl().removeImage(geom_pixmap); |
416 | 413 | ||
@@ -420,13 +417,28 @@ BScreen::~BScreen() { | |||
420 | removeWorkspaceNames(); | 417 | removeWorkspaceNames(); |
421 | 418 | ||
422 | destroyAndClearList(m_workspaces_list); | 419 | destroyAndClearList(m_workspaces_list); |
423 | destroyAndClearList(m_icon_list); | ||
424 | destroyAndClearList(m_netizen_list); | 420 | destroyAndClearList(m_netizen_list); |
425 | 421 | ||
422 | //why not destroyAndClearList(m_icon_list); ? | ||
423 | //problem with that: a delete FluxboxWindow* calls m_diesig.notify() | ||
424 | //which leads to screen.removeWindow() which leads to removeIcon(win) | ||
425 | //which would modify the m_icon_list anyways... | ||
426 | Icons tmp; | ||
427 | tmp = m_icon_list; | ||
428 | while(!tmp.empty()) { | ||
429 | removeWindow(tmp.back()); | ||
430 | tmp.back()->restore(true); | ||
431 | delete (tmp.back()); | ||
432 | tmp.pop_back(); | ||
433 | } | ||
434 | |||
426 | if (hasXinerama() && m_xinerama_headinfo) { | 435 | if (hasXinerama() && m_xinerama_headinfo) { |
427 | delete [] m_xinerama_headinfo; | 436 | delete [] m_xinerama_headinfo; |
428 | } | 437 | } |
429 | 438 | ||
439 | // slit must be destroyed before headAreas (Struts) | ||
440 | m_slit.reset(0); | ||
441 | |||
430 | // TODO fluxgen: check if this is the right place | 442 | // TODO fluxgen: check if this is the right place |
431 | delete [] m_head_areas; | 443 | delete [] m_head_areas; |
432 | } | 444 | } |
@@ -771,7 +783,7 @@ void BScreen::addIcon(FluxboxWindow *w) { | |||
771 | void BScreen::removeIcon(FluxboxWindow *w) { | 783 | void BScreen::removeIcon(FluxboxWindow *w) { |
772 | if (w == 0) | 784 | if (w == 0) |
773 | return; | 785 | return; |
774 | 786 | ||
775 | Icons::iterator erase_it = remove_if(getIconList().begin(), | 787 | Icons::iterator erase_it = remove_if(getIconList().begin(), |
776 | getIconList().end(), | 788 | getIconList().end(), |
777 | bind2nd(equal_to<FluxboxWindow *>(), w)); | 789 | bind2nd(equal_to<FluxboxWindow *>(), w)); |
@@ -1677,8 +1689,6 @@ void BScreen::initMenu() { | |||
1677 | 1689 | ||
1678 | } | 1690 | } |
1679 | 1691 | ||
1680 | |||
1681 | |||
1682 | if (m_rootmenu.get() == 0) { | 1692 | if (m_rootmenu.get() == 0) { |
1683 | _FB_USES_NLS; | 1693 | _FB_USES_NLS; |
1684 | m_rootmenu.reset(createMenu(_FBTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu"))); | 1694 | m_rootmenu.reset(createMenu(_FBTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu"))); |
@@ -1841,7 +1851,6 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1841 | #endif // HAVE_XRENDER | 1851 | #endif // HAVE_XRENDER |
1842 | #undef _BOOLITEM | 1852 | #undef _BOOLITEM |
1843 | 1853 | ||
1844 | |||
1845 | // finaly update menu | 1854 | // finaly update menu |
1846 | menu.update(); | 1855 | menu.update(); |
1847 | } | 1856 | } |
@@ -1854,7 +1863,6 @@ void BScreen::shutdown() { | |||
1854 | for_each(m_workspaces_list.begin(), | 1863 | for_each(m_workspaces_list.begin(), |
1855 | m_workspaces_list.end(), | 1864 | m_workspaces_list.end(), |
1856 | mem_fun(&Workspace::shutdown)); | 1865 | mem_fun(&Workspace::shutdown)); |
1857 | |||
1858 | } | 1866 | } |
1859 | 1867 | ||
1860 | 1868 | ||
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index fb846e0..c87278f 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -465,6 +465,12 @@ Fluxbox::~Fluxbox() { | |||
465 | delete m_toolbars.back(); | 465 | delete m_toolbars.back(); |
466 | m_toolbars.pop_back(); | 466 | m_toolbars.pop_back(); |
467 | } | 467 | } |
468 | |||
469 | // destroy screens | ||
470 | while (!m_screen_list.empty()) { | ||
471 | delete m_screen_list.back(); | ||
472 | m_screen_list.pop_back(); | ||
473 | } | ||
468 | 474 | ||
469 | // destroy atomhandlers | 475 | // destroy atomhandlers |
470 | for (AtomHandlerContainerIt it= m_atomhandler.begin(); | 476 | for (AtomHandlerContainerIt it= m_atomhandler.begin(); |
@@ -472,11 +478,7 @@ Fluxbox::~Fluxbox() { | |||
472 | it++) { | 478 | it++) { |
473 | delete (*it).first; | 479 | delete (*it).first; |
474 | } | 480 | } |
475 | 481 | m_atomhandler.clear(); | |
476 | while (!m_screen_list.empty()) { | ||
477 | delete m_screen_list.back(); | ||
478 | m_screen_list.pop_back(); | ||
479 | } | ||
480 | 482 | ||
481 | clearMenuFilenames(); | 483 | clearMenuFilenames(); |
482 | } | 484 | } |
@@ -1159,11 +1161,13 @@ void Fluxbox::update(FbTk::Subject *changedsub) { | |||
1159 | (*it).first->updateLayer(win); | 1161 | (*it).first->updateLayer(win); |
1160 | } | 1162 | } |
1161 | } else if ((&(win.dieSig())) == changedsub) { // window death signal | 1163 | } else if ((&(win.dieSig())) == changedsub) { // window death signal |
1164 | |||
1162 | for (AtomHandlerContainerIt it= m_atomhandler.begin(); | 1165 | for (AtomHandlerContainerIt it= m_atomhandler.begin(); |
1163 | it != m_atomhandler.end(); ++it) { | 1166 | it != m_atomhandler.end(); ++it) { |
1164 | if ((*it).first->update()) | 1167 | if ((*it).first->update()) |
1165 | (*it).first->updateFrameClose(win); | 1168 | (*it).first->updateFrameClose(win); |
1166 | } | 1169 | } |
1170 | |||
1167 | // make sure each workspace get this | 1171 | // make sure each workspace get this |
1168 | BScreen &scr = win.screen(); | 1172 | BScreen &scr = win.screen(); |
1169 | scr.removeWindow(&win); | 1173 | scr.removeWindow(&win); |