forked from mirror/OpenTTD
(svn r13412) -Add: OTTDThreadTerminateFunc, for all thread systems, which is called when a thread is terminated. Now GenWorld- and SaveLoad-thread cleanup theirselves correctly, while Fibers don't (as that causes access-violations)
This commit is contained in:
@@ -288,7 +288,7 @@ void GenerateWorld(GenerateWorldMode mode, uint size_x, uint size_y)
|
||||
SetupColorsAndInitialWindow();
|
||||
|
||||
if (_network_dedicated ||
|
||||
(_gw.thread = ThreadObject::New(&_GenerateWorld, NULL)) == NULL) {
|
||||
(_gw.thread = ThreadObject::New(&_GenerateWorld, NULL, &ThreadObject::TerminateCleanup)) == NULL) {
|
||||
DEBUG(misc, 1, "Cannot create genworld thread, reverting to single-threaded mode");
|
||||
_gw.threaded = false;
|
||||
_GenerateWorld(NULL);
|
||||
|
Reference in New Issue
Block a user