aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/worldserver/Main.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp
index 8f08a00a734..cf2b09491d8 100644
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -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();