Core/Misc: Fixed worldserver shutdown with --update-databases-only

This commit is contained in:
Shauren
2022-10-13 12:53:54 +02:00
parent 6d9625802c
commit edc922d532

View File

@@ -257,6 +257,8 @@ extern int main(int argc, char** argv)
for (int i = 0; i < numThreads; ++i)
threadPool->PostWork([ioContext]() { ioContext->run(); });
std::shared_ptr<void> ioContextStopHandle(nullptr, [ioContext](void*) { ioContext->stop(); });
// Set process priority according to configuration settings
SetProcessPriority("server.worldserver", sConfigMgr->GetIntDefault(CONFIG_PROCESSOR_AFFINITY, 0), sConfigMgr->GetBoolDefault(CONFIG_HIGH_PRIORITY, false));
@@ -400,7 +402,7 @@ extern int main(int argc, char** argv)
WorldPackets::Auth::ConnectTo::ShutdownEncryption();
WorldPackets::Auth::EnterEncryptedMode::ShutdownEncryption();
ioContext->stop();
ioContextStopHandle.reset();
threadPool.reset();