diff options
author | rubidium <rubidium@openttd.org> | 2008-05-15 11:17:56 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-15 11:17:56 +0000 |
commit | c709b8a711039a12c4e105e9ec9c768f20cbf4a8 (patch) | |
tree | 7f8375ad9c71f349b2371ab9daf56555c928ce73 | |
parent | 35c14f45bedea917cd85c4c0033c6f46e2ac712b (diff) | |
download | openttd-c709b8a711039a12c4e105e9ec9c768f20cbf4a8.tar.xz |
(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.
-rw-r--r-- | src/window.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/window.cpp b/src/window.cpp index 09320a003..f759784a2 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; |