Fix for crash when exiting whilst NewGRF scan still in progress

See: https://github.com/OpenTTD/OpenTTD/issues/8760
This commit is contained in:
Jonathan G Rennison
2021-03-01 18:04:12 +00:00
parent f183ded9fe
commit 0a31a3b923
5 changed files with 33 additions and 1 deletions

View File

@@ -1006,8 +1006,10 @@ int openttd_main(int argc, char *argv[])
CrashLog::MainThreadExitCheckPendingCrashlog();
AbortScanNewGRFFiles();
WaitTillSaved();
WaitTillGeneratedWorld(); // Make sure any generate world threads have been joined.
WaitUntilModalProgressCompleted();
/* only save config if we have to */
if (_save_config) {