summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Screen.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 626b296..715411c 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -36,6 +36,8 @@
36#include "FocusControl.hh" 36#include "FocusControl.hh"
37#include "ScreenPlacement.hh" 37#include "ScreenPlacement.hh"
38 38
39#include "STLUtil.hh"
40
39// themes 41// themes
40#include "FbWinFrameTheme.hh" 42#include "FbWinFrameTheme.hh"
41#include "MenuTheme.hh" 43#include "MenuTheme.hh"
@@ -463,16 +465,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
463 XFlush(disp); 465 XFlush(disp);
464} 466}
465 467
466template <typename A>
467void destroyAndClearList(A &a) {
468 typedef typename A::iterator iterator;
469 iterator it = a.begin();
470 iterator it_end = a.end();
471 for (; it != it_end; ++it)
472 delete (*it);
473 468
474 a.clear();
475}
476 469
477BScreen::~BScreen() { 470BScreen::~BScreen() {
478 471
@@ -512,12 +505,12 @@ BScreen::~BScreen() {
512 imageControl().removeImage(pos_pixmap); 505 imageControl().removeImage(pos_pixmap);
513 506
514 removeWorkspaceNames(); 507 removeWorkspaceNames();
508 using namespace STLUtil;
509 destroyAndClear(m_workspaces_list);
510 destroyAndClear(m_netizen_list);
511 destroyAndClear(m_managed_resources);
515 512
516 destroyAndClearList(m_workspaces_list); 513 //why not destroyAndClear(m_icon_list); ?
517 destroyAndClearList(m_netizen_list);
518 destroyAndClearList(m_managed_resources);
519
520 //why not destroyAndClearList(m_icon_list); ?
521 //problem with that: a delete FluxboxWindow* calls m_diesig.notify() 514 //problem with that: a delete FluxboxWindow* calls m_diesig.notify()
522 //which leads to screen.removeWindow() which leads to removeIcon(win) 515 //which leads to screen.removeWindow() which leads to removeIcon(win)
523 //which would modify the m_icon_list anyways... 516 //which would modify the m_icon_list anyways...