diff --git a/core/HandleSys.cpp b/core/HandleSys.cpp index 5b91a838..be10bb60 100644 --- a/core/HandleSys.cpp +++ b/core/HandleSys.cpp @@ -950,6 +950,10 @@ bool HandleSystem::InitAccessDefaults(TypeAccess *pTypeAccess, HandleAccess *pHa return true; } +#define HANDLE_LOG_VERY_BAD(message, ...) \ + g_Logger.LogFatal(message, ##__VA_ARGS__); \ + g_Logger.LogError(message, ##__VA_ARGS__); + bool HandleSystem::TryAndFreeSomeHandles() { IPluginIterator *pl_iter = g_PluginSys.GetPluginIterator(); @@ -995,9 +999,9 @@ bool HandleSystem::TryAndFreeSomeHandles() return false; } - g_Logger.LogFatal("[SM] MEMORY LEAK DETECTED IN PLUGIN (file \"%s\")", highest_owner->GetFilename()); - g_Logger.LogFatal("[SM] Unloading plugin to free %d handles.", highest_handle_count); - g_Logger.LogFatal("[SM] Contact the author(s) of this plugin to correct this error.", highest_handle_count); + HANDLE_LOG_VERY_BAD("[SM] MEMORY LEAK DETECTED IN PLUGIN (file \"%s\")", highest_owner->GetFilename()); + HANDLE_LOG_VERY_BAD("[SM] Unloading plugin to free %d handles.", highest_handle_count); + HANDLE_LOG_VERY_BAD("[SM] Contact the author(s) of this plugin to correct this error.", highest_handle_count); highest_owner->GetBaseContext()->ThrowNativeErrorEx(SP_ERROR_MEMACCESS, "Memory leak");