From 514c0eaec5b155718ea1e92c45a7c6f2500d681a Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Fri, 29 Jun 2018 17:11:32 -0400 Subject: [PATCH] fix: Fixing bug where Timer.Reset() would continue repeating on an interval in Net Standard --- CHANGELOG.md | 1 + ICD.Common.Utils/Timers/SafeTimer.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1079385..2a8aaec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - Potential fix for timer disposal on Net Standard - Added workaround for older RPC servers where the typestring being broadcast would stil include _SimplSharp, now will be stripped + - Fixing bug where Timer.Reset() would continue repeating on an interval in Net Standard ## [3.6.0] - 2018-06-19 ### Added diff --git a/ICD.Common.Utils/Timers/SafeTimer.cs b/ICD.Common.Utils/Timers/SafeTimer.cs index 533d30c..747c092 100644 --- a/ICD.Common.Utils/Timers/SafeTimer.cs +++ b/ICD.Common.Utils/Timers/SafeTimer.cs @@ -117,7 +117,7 @@ namespace ICD.Common.Utils.Timers } /// - /// Callback is called after the dueTime milliseconds. + /// Callback is called once after the dueTime milliseconds. /// /// public void Reset(long dueTime) @@ -125,7 +125,7 @@ namespace ICD.Common.Utils.Timers #if SIMPLSHARP m_Timer.Reset(dueTime); #else - m_Timer.Change((int)dueTime, m_RepeatPeriod); + m_Timer.Change((int)dueTime, Timeout.Infinite); #endif }