From 009a748ab33a77613aad7d269a79eb74a3be5080 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 15 May 2008 11:17:56 +0000 Subject: [PATCH] (svn r13099) -Fix [FS#2014]: when a window had children only one of them would be closed (on a parent closure) instead of all children. --- src/window.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/window.cpp b/src/window.cpp index 09320a003d..f759784a2a 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -626,8 +626,12 @@ Window::~Window() memmove(wz, wz + 1, (byte*)_last_z_window - (byte*)wz); _last_z_window--; - /* Delete any children a window might have in a head-recursive manner */ - delete FindChildWindow(this); + /* Delete all children a window might have in a head-recursive manner */ + Window *child = FindChildWindow(this); + while (child != NULL) { + delete child; + child = FindChildWindow(this); + } WindowEvent e; e.event = WE_DESTROY;