From 14b61bfa6fb6812bdc9739402956c3dfa3a4c12b Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Tue, 9 Mar 2021 20:19:27 +0100 Subject: [PATCH] Fix #8833: don't reload NewGRFs when we are shutting down Otherwise that might cause calls to the video-driver, which are already shut down by now. This causes, depending on the video-driver crashes or weird effects. --- src/newgrf_gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 4e63eafbe6..9ed21e5c57 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -663,7 +663,7 @@ struct NewGRFWindow : public Window, NewGRFScanCallback { DeleteWindowByClass(WC_TEXTFILE); DeleteWindowByClass(WC_SAVE_PRESET); - if (this->editable && !this->execute) { + if (this->editable && !this->execute && !_exit_game) { CopyGRFConfigList(this->orig_list, this->actives, true); ResetGRFConfig(false); ReloadNewGRFData();