summaryrefslogtreecommitdiff
path: root/src/osk_gui.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-05-14 02:32:35 +0000
committerglx <glx@openttd.org>2008-05-14 02:32:35 +0000
commitbbc173dfc6461834c7f3419540dd49fa9c2b06d5 (patch)
tree0be07031b976ab2771225c114f86a99f9567e808 /src/osk_gui.cpp
parentc9f26cceb75735130c3cf41a49ceff237491298d (diff)
downloadopenttd-bbc173dfc6461834c7f3419540dd49fa9c2b06d5.tar.xz
(svn r13083) -Fix (r13042): another segmentation fault when OskWindow's parent closes it
Diffstat (limited to 'src/osk_gui.cpp')
-rw-r--r--src/osk_gui.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp
index 49d869765..32d7ff41c 100644
--- a/src/osk_gui.cpp
+++ b/src/osk_gui.cpp
@@ -171,6 +171,8 @@ struct OskWindow : public Window {
/* pass information by simulating a button press on parent window */
if (this->ok_btn != 0) {
this->parent->OnClick(pt, this->ok_btn);
+ /* Window gets deleted when the parent window removes itself. */
+ return;
}
}
delete_this = true;
@@ -180,6 +182,7 @@ struct OskWindow : public Window {
if (this->cancel_btn != 0) { // pass a cancel event to the parent window
this->parent->OnClick(pt, this->cancel_btn);
/* Window gets deleted when the parent window removes itself. */
+ return;
} else { // or reset to original string
strcpy(qs->text.buf, this->orig_str_buf);
UpdateTextBufferSize(&qs->text);