mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/Logging: Force synchronous logging after io_service shutdown - fixes logging on worldserver shutdown
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -255,6 +255,8 @@ extern int main(int argc, char** argv)
|
||||
// Shutdown starts here
|
||||
ShutdownThreadPool(threadPool);
|
||||
|
||||
sLog->SetSynchronous();
|
||||
|
||||
sScriptMgr->OnShutdown();
|
||||
|
||||
sIpcContext->Close();
|
||||
|
||||
Reference in New Issue
Block a user