(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.
authorrubidium
Thu, 15 May 2008 11:17:56 +0000
changeset 9233 b29c7a028999
parent 9232 0a94fea18c79
child 9234 bfc9d27d3d0d
(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
--- a/src/window.cpp	Thu May 15 08:01:46 2008 +0000
+++ b/src/window.cpp	Thu May 15 11:17:56 2008 +0000
@@ -626,8 +626,12 @@
 	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;