From f37c188b5a76a4c76bc62c7c13a9aac613663ece Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Tue, 24 May 2011 18:54:43 -0400 Subject: [PATCH] Handle leak notice now prints to error log (as well as fatal) (bug 4929, r=dvander). --- core/HandleSys.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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");