Skip to content

Commit

Permalink
Core/Misc: Prevent calling ACE_Task_Base::wait() on an invalid handle…
Browse files Browse the repository at this point in the history
…. WorldSocketMgr::Wait is already called in WorldRunnable post-service hook
  • Loading branch information
Machiavell1 committed Mar 28, 2012
1 parent cc0448a commit e95d614
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/server/worldserver/Master.cpp
Expand Up @@ -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)
{
Expand All @@ -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();

Expand Down

0 comments on commit e95d614

Please sign in to comment.