Core/Logging: Force synchronous logging after io_service shutdown - fixes logging on worldserver shutdown

(cherry picked from commit a0b2be6c1d0ae17ad8a17692d77f2020bbb9296e)
This commit is contained in:
Shauren authored and Aokromes committed 2016-05-05 03:35:07 +02:00
1 parent 9d4e537a62
commit fe64bdddb3
3 files changed
+10

No files matched your search

+7
View File
@@ -337,6 +337,13 @@ void Log::Initialize(boost::asio::io_service* ioService)
LoadFromConfig();
}
void Log::SetSynchronous()
{
delete _strand;
_strand = nullptr;
_ioService = nullptr;
}
void Log::LoadFromConfig()
{
Close();
+1
View File
@@ -47,6 +47,7 @@ class Log
static Log* instance();
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;
+2
View File
@@ -248,6 +248,8 @@ extern int main(int argc, char** argv)
// Shutdown starts here
ShutdownThreadPool(threadPool);
sLog->SetSynchronous();
sScriptMgr->OnShutdown();
sIpcContext->Close();