(svn r13304) -Fix (r13042): possible double free (showed up in r13092)
authorsmatz
Tue, 27 May 2008 23:40:36 +0000
changeset 10754 e190e710da4e
parent 10753 428f22725618
child 10755 3661f65e2211
(svn r13304) -Fix (r13042): possible double free (showed up in r13092)
src/misc_gui.cpp
--- a/src/misc_gui.cpp	Tue May 27 23:10:42 2008 +0000
+++ b/src/misc_gui.cpp	Tue May 27 23:40:36 2008 +0000
@@ -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);
 	}