summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-05-27 23:40:36 +0000
committersmatz <smatz@openttd.org>2008-05-27 23:40:36 +0000
commitf505e4e40792c0090c876ee6275266c3710d45b0 (patch)
treee23191ee667122ba5386c44213cff446638871c7
parent47c22cffce6483c80ec2ce86bcf63f5467dfc651 (diff)
downloadopenttd-f505e4e40792c0090c876ee6275266c3710d45b0.tar.xz
(svn r13304) -Fix (r13042): possible double free (showed up in r13092)
-rw-r--r--src/misc_gui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 9cf128662..ac64a4fcc 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -1093,8 +1093,9 @@ struct QueryStringWindow : public QueryStringBaseWindow
~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);
}