all repos — fluxbox @ 19bc596b84b26f6c3022d05973ae514a50eeeea1

custom fork of the fluxbox windowmanager

fix segfaults on restart/exit, still issues with former iconified windows
at startup of fluxbox

should close #1067582, #1067580, #1060912
mathias mathias
commit

19bc596b84b26f6c3022d05973ae514a50eeeea1

parent

e5b5984eca548c13ad82b02d96b6b4a9496d15d4

2 files changed, 27 insertions(+), 15 deletions(-)

jump to
M src/Screen.ccsrc/Screen.cc

@@ -408,9 +408,6 @@ // Since workspacemenu holds client list menus (from workspace)

// we need to destroy it before we destroy workspaces m_workspacemenu.reset(0); - // slit must be destroyed before headAreas (Struts) - m_slit.reset(0); - if (geom_pixmap != None) imageControl().removeImage(geom_pixmap);

@@ -420,12 +417,27 @@

removeWorkspaceNames(); destroyAndClearList(m_workspaces_list); - destroyAndClearList(m_icon_list); destroyAndClearList(m_netizen_list); + //why not destroyAndClearList(m_icon_list); ? + //problem with that: a delete FluxboxWindow* calls m_diesig.notify() + //which leads to screen.removeWindow() which leads to removeIcon(win) + //which would modify the m_icon_list anyways... + Icons tmp; + tmp = m_icon_list; + while(!tmp.empty()) { + removeWindow(tmp.back()); + tmp.back()->restore(true); + delete (tmp.back()); + tmp.pop_back(); + } + if (hasXinerama() && m_xinerama_headinfo) { delete [] m_xinerama_headinfo; } + + // slit must be destroyed before headAreas (Struts) + m_slit.reset(0); // TODO fluxgen: check if this is the right place delete [] m_head_areas;

@@ -771,7 +783,7 @@

void BScreen::removeIcon(FluxboxWindow *w) { if (w == 0) return; - + Icons::iterator erase_it = remove_if(getIconList().begin(), getIconList().end(), bind2nd(equal_to<FluxboxWindow *>(), w));

@@ -1677,8 +1689,6 @@ screenNumber(), true));

} - - if (m_rootmenu.get() == 0) { _FB_USES_NLS; m_rootmenu.reset(createMenu(_FBTEXT(Menu, DefaultRootMenu, "Fluxbox default menu", "Title of fallback root menu")));

@@ -1841,7 +1851,6 @@ }

#endif // HAVE_XRENDER #undef _BOOLITEM - // finaly update menu menu.update(); }

@@ -1854,7 +1863,6 @@ m_shutdown = true;

for_each(m_workspaces_list.begin(), m_workspaces_list.end(), mem_fun(&Workspace::shutdown)); - }
M src/fluxbox.ccsrc/fluxbox.cc

@@ -465,6 +465,12 @@ while (!m_toolbars.empty()) {

delete m_toolbars.back(); m_toolbars.pop_back(); } + + // destroy screens + while (!m_screen_list.empty()) { + delete m_screen_list.back(); + m_screen_list.pop_back(); + } // destroy atomhandlers for (AtomHandlerContainerIt it= m_atomhandler.begin();

@@ -472,11 +478,7 @@ it != m_atomhandler.end();

it++) { delete (*it).first; } - - while (!m_screen_list.empty()) { - delete m_screen_list.back(); - m_screen_list.pop_back(); - } + m_atomhandler.clear(); clearMenuFilenames(); }

@@ -1159,11 +1161,13 @@ if ((*it).first->update())

(*it).first->updateLayer(win); } } else if ((&(win.dieSig())) == changedsub) { // window death signal + for (AtomHandlerContainerIt it= m_atomhandler.begin(); - it != m_atomhandler.end(); ++it) { + it != m_atomhandler.end(); ++it) { if ((*it).first->update()) (*it).first->updateFrameClose(win); } + // make sure each workspace get this BScreen &scr = win.screen(); scr.removeWindow(&win);