From 9284a90d41f11b9c716739bdfc394223eb5996fe Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Sun, 11 Nov 2007 20:40:08 +0000 Subject: [PATCH] added further error logging for timer closing --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401680 --- core/smn_timers.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/smn_timers.cpp b/core/smn_timers.cpp index bd7b54fa..ee5214c6 100644 --- a/core/smn_timers.cpp +++ b/core/smn_timers.cpp @@ -31,6 +31,7 @@ #include "HandleSys.h" #include "TimerSys.h" +#include "PluginSys.h" #include "Logger.h" #define TIMER_HNDL_CLOSE (1<<9) @@ -153,7 +154,14 @@ void TimerNatives::OnTimerEnd(ITimer *pTimer, void *pData) } } - g_HandleSys.FreeHandle(pInfo->TimerHandle, &sec); + if ((herr=g_HandleSys.FreeHandle(pInfo->TimerHandle, &sec)) != HandleError_None) + { + g_Logger.LogError("Invalid timer handle %x (error %d) on plugin %s during timer end", + pInfo->TimerHandle, + herr, + g_PluginSys.FindPluginByContext(pInfo->pContext->GetContext())->GetFilename()); + return; + } DeleteTimerInfo(pInfo); }