From f3eb92dd39c876544a25e327f563b1aa19bab804 Mon Sep 17 00:00:00 2001 From: fluxgen <fluxgen> Date: Sun, 10 Feb 2002 19:05:12 +0000 Subject: fixed bug in shutdown --- src/Workspace.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Workspace.cc b/src/Workspace.cc index d92ef76..8f0433f 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Workspace.cc,v 1.9 2002/02/09 16:41:53 fluxgen Exp $ +// $Id: Workspace.cc,v 1.10 2002/02/10 19:05:12 fluxgen Exp $ // use GNU extensions #ifndef _GNU_SOURCE @@ -55,6 +55,8 @@ #include <X11/Xatom.h> #include <algorithm> +#include <iostream> +using namespace std; Workspace::Workspace(BScreen *scrn, int i): screen(scrn), @@ -332,12 +334,12 @@ void Workspace::setName(char *new_name) { void Workspace::shutdown(void) { - Windows::iterator it = windowList.begin(); - Windows::iterator it_end= windowList.end(); - for (; it != it_end; ++it) { - (*it)->restore(); - delete (*it); + + while (!windowList.empty()) { + windowList.back()->restore(); + delete windowList.back(); //delete window (the window removes it self from windowList) } + } -- cgit v0.11.2