changeset 9393:aeff7240b474 draft

(svn r13304) -Fix (r13042): possible double free (showed up in r13092)
author smatz <smatz@openttd.org>
date Tue, 27 May 2008 23:40:36 +0000
parents 8cc5852fb03f
children f62de1e2ea9a
files src/misc_gui.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -1093,8 +1093,9 @@
 	~QueryStringWindow()
 	{
 		if (!this->handled && this->parent != NULL) {
-			this->handled = true;
-			this->parent->OnQueryTextFinished(NULL);
+			Window *parent = this->parent;
+			this->parent = NULL; // so parent doesn't try to delete us again
+			parent->OnQueryTextFinished(NULL);
 		}
 		ClrBit(_no_scroll, SCROLL_EDIT);
 	}