all repos — fluxbox @ 806addad8e1220cbf9ab5228e662f24e4f3dcd52

custom fork of the fluxbox windowmanager

moved destroyAndClearList from Screen.cc to STLUtil::destroyAndClear
fluxgen fluxgen
commit

806addad8e1220cbf9ab5228e662f24e4f3dcd52

parent

36f5a46fd74c55d5926173c5a51ae9a565e32372

1 files changed, 7 insertions(+), 14 deletions(-)

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

@@ -36,6 +36,8 @@ #include "Layer.hh"

#include "FocusControl.hh" #include "ScreenPlacement.hh" +#include "STLUtil.hh" + // themes #include "FbWinFrameTheme.hh" #include "MenuTheme.hh"

@@ -463,16 +465,7 @@

XFlush(disp); } -template <typename A> -void destroyAndClearList(A &a) { - typedef typename A::iterator iterator; - iterator it = a.begin(); - iterator it_end = a.end(); - for (; it != it_end; ++it) - delete (*it); - a.clear(); -} BScreen::~BScreen() {

@@ -512,12 +505,12 @@ if (pos_pixmap != None)

imageControl().removeImage(pos_pixmap); removeWorkspaceNames(); - - destroyAndClearList(m_workspaces_list); - destroyAndClearList(m_netizen_list); - destroyAndClearList(m_managed_resources); + using namespace STLUtil; + destroyAndClear(m_workspaces_list); + destroyAndClear(m_netizen_list); + destroyAndClear(m_managed_resources); - //why not destroyAndClearList(m_icon_list); ? + //why not destroyAndClear(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...