From e708ef9603279e219b8bc137033bbc3897b0b21c Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Mon, 21 Jan 2019 11:49:21 -0500 Subject: [PATCH] fix: Fix for potential memory leak with timers --- ICD.Common.Utils/Timers/SafeTimer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ICD.Common.Utils/Timers/SafeTimer.cs b/ICD.Common.Utils/Timers/SafeTimer.cs index 526c80e..1047f7d 100644 --- a/ICD.Common.Utils/Timers/SafeTimer.cs +++ b/ICD.Common.Utils/Timers/SafeTimer.cs @@ -20,7 +20,7 @@ namespace ICD.Common.Utils.Timers private readonly Timer m_Timer; private int m_RepeatPeriod; #endif - private readonly Action m_Callback; + private Action m_Callback; /// /// Returns true if this instance has been disposed. @@ -88,6 +88,8 @@ namespace ICD.Common.Utils.Timers Stop(); m_Timer.Dispose(); + m_Callback = null; + IsDisposed = true; }