src/window.cpp
changeset 10555 414de10c37a9
parent 10525 da5bc725cda4
child 10586 ddbc8067d186
--- 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;