summaryrefslogtreecommitdiff
path: root/src
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
commite15863fa7785583291ae2d03ccbdf5b3e8377047 (patch)
treee23191ee667122ba5386c44213cff446638871c7 /src
parent8aa797603c4588195b2a28364651e99b719481ba (diff)
downloadopenttd-e15863fa7785583291ae2d03ccbdf5b3e8377047.tar.xz
(svn r13304) -Fix (r13042): possible double free (showed up in r13092)
Diffstat (limited to 'src')
-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);
}