aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-10-13 12:53:54 +0200
committerShauren <shauren.trinity@gmail.com>2022-10-13 12:54:40 +0200
commit966e38ab75174a74ca3dce66d36ada091ab6ecb9 (patch)
treed2a29dca996f5fe2cf09b3a5c855bb86a0c5cc3f /src
parent4ef99cfdfafb24bae901aad43fd7b8f8ccacd497 (diff)
Core/Misc: Fixed worldserver shutdown with --update-databases-only
(cherry picked from commit edc922d5320788a08b02d22b1dbe29b7becb9b93)
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 68978183f51..9f601f8ceb1 100644
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -253,6 +253,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));
@@ -387,7 +389,7 @@ extern int main(int argc, char** argv)
WorldUpdateLoop();
// Shutdown starts here
- ioContext->stop();
+ ioContextStopHandle.reset();
threadPool.reset();