Common: Fix logging shutdown race condition.

Got a crash during logging on another thread during shutdown.
This commit is contained in:
Unknown W. Brackets committed 2021-01-01 08:38:27 -08:00
1 parent 84aa33970b
commit f57c642f0b
2 files changed
+12 -8

No files matched your search

+8 -8
View File
@@ -1402,14 +1402,6 @@ void NativeShutdown() {
#endif
g_Config.Save("NativeShutdown");
// Avoid shutting this down when restarting core.
if (!restarting)
LogManager::Shutdown();
#ifdef ANDROID_NDK_PROFILER
moncleanup();
#endif
INFO_LOG(SYSTEM, "NativeShutdown called");
ShutdownWebServer();
@@ -1420,6 +1412,14 @@ void NativeShutdown() {
g_Discord.Shutdown();
// Avoid shutting this down when restarting core.
if (!restarting)
LogManager::Shutdown();
#ifdef ANDROID_NDK_PROFILER
moncleanup();
#endif
if (logger) {
delete logger;
logger = nullptr;