diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/worldserver/Master.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index f4945e025b0..03b2859c514 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -270,7 +270,11 @@ int Master::Run() LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_INVALID, realmID); sLog->outString("%s (worldserver-daemon) ready...", _FULLVERSION); - sWorldSocketMgr->Wait(); + + // when the main thread closes the singletons get unloaded + // since worldrunnable uses them, it will crash if unloaded after master + world_thread.wait(); + rar_thread.wait(); if (soap_thread) { @@ -282,11 +286,6 @@ int Master::Run() // set server offline LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag | %u WHERE id = '%d'", REALM_FLAG_OFFLINE, realmID); - // when the main thread closes the singletons get unloaded - // since worldrunnable uses them, it will crash if unloaded after master - world_thread.wait(); - rar_thread.wait(); - ///- Clean database before leaving ClearOnlineAccounts(); |