aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authormathias <mathias>2004-11-20 18:12:51 (GMT)
committermathias <mathias>2004-11-20 18:12:51 (GMT)
commit19bc596b84b26f6c3022d05973ae514a50eeeea1 (patch)
tree3e40c2506edefc523c36d304a2580e3b4e00bfb9 /src/Screen.cc
parente5b5984eca548c13ad82b02d96b6b4a9496d15d4 (diff)
downloadfluxbox_pavel-19bc596b84b26f6c3022d05973ae514a50eeeea1.zip
fluxbox_pavel-19bc596b84b26f6c3022d05973ae514a50eeeea1.tar.bz2
fix segfaults on restart/exit, still issues with former iconified windows
at startup of fluxbox should close #1067582, #1067580, #1060912
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc26
1 files changed, 17 insertions, 9 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) {
771void BScreen::removeIcon(FluxboxWindow *w) { 783void 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