diff options
-rw-r--r-- | src/common/Logging/Log.cpp | 7 | ||||
-rw-r--r-- | src/common/Logging/Log.h | 1 | ||||
-rw-r--r-- | src/server/worldserver/Main.cpp | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp index fb5b9165235..7e1a378b824 100644 --- a/src/common/Logging/Log.cpp +++ b/src/common/Logging/Log.cpp @@ -332,6 +332,13 @@ void Log::Initialize(boost::asio::io_service* ioService) LoadFromConfig(); } +void Log::SetSynchronous() +{ + delete _strand; + _strand = nullptr; + _ioService = nullptr; +} + void Log::LoadFromConfig() { Close(); diff --git a/src/common/Logging/Log.h b/src/common/Logging/Log.h index a90481ad5d2..eafd7412a94 100644 --- a/src/common/Logging/Log.h +++ b/src/common/Logging/Log.h @@ -51,6 +51,7 @@ class Log } void Initialize(boost::asio::io_service* ioService); + void SetSynchronous(); // Not threadsafe - should only be called from main() after all threads are joined void LoadFromConfig(); void Close(); bool ShouldLog(std::string const& type, LogLevel level) const; diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 46bcad1c37f..2f556b3fa64 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -255,6 +255,8 @@ extern int main(int argc, char** argv) // Shutdown starts here ShutdownThreadPool(threadPool); + sLog->SetSynchronous(); + sScriptMgr->OnShutdown(); sIpcContext->Close(); |