diff options
author | rubidium <rubidium@openttd.org> | 2009-10-31 14:53:19 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-10-31 14:53:19 +0000 |
commit | 86fd0c0bcefd51d4e173ea1287d0b447b2410bfe (patch) | |
tree | 6e31997d3f43852034efb2a56e3e43379c1bf69e /src/newgrf_gui.cpp | |
parent | 617e7966f9efd260c02fa252aa106200eddefc7c (diff) | |
download | openttd-86fd0c0bcefd51d4e173ea1287d0b447b2410bfe.tar.xz |
(svn r17922) -Fix [FS#3291]: crash when closing NewGRF parameter window with no NewGRF selected
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r-- | src/newgrf_gui.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index c9ac27f3c..5319b1c3f 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -749,6 +749,7 @@ struct NewGRFWindow : public Window { this->sel = newsel; this->preset = -1; this->InvalidateData(); + this->DeleteChildWindows(WC_QUERY_STRING); // Remove the parameter query window break; } @@ -791,6 +792,8 @@ struct NewGRFWindow : public Window { uint i = (pt.y - this->GetWidget<NWidgetBase>(SNGRFS_FILE_LIST)->pos_y) / this->resize.step_height + this->vscroll.GetPosition(); for (c = this->list; c != NULL && i > 0; c = c->next, i--) {} + + if (this->sel != c) this->DeleteChildWindows(WC_QUERY_STRING); // Remove the parameter query window this->sel = c; this->InvalidateData(); |