mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
fix: Fixed a bug where SafeTimer.Trigger would call the callback twice on NetStandard
This commit is contained in:
@@ -49,12 +49,14 @@ namespace ICD.Common.Utils.Tests.Timers
|
||||
[Test]
|
||||
public void TriggerTest()
|
||||
{
|
||||
bool called = false;
|
||||
SafeTimer timer = SafeTimer.Stopped(() => called = true);
|
||||
int called = 0;
|
||||
SafeTimer timer = SafeTimer.Stopped(() => called++);
|
||||
|
||||
timer.Trigger();
|
||||
|
||||
Assert.IsTrue(called);
|
||||
ThreadingUtils.Sleep(50);
|
||||
|
||||
Assert.AreEqual(1, called);
|
||||
|
||||
timer.Dispose();
|
||||
}
|
||||
|
||||
@@ -112,7 +112,6 @@ namespace ICD.Common.Utils.Timers
|
||||
m_Timer.Reset();
|
||||
#else
|
||||
m_Timer.Change(0, m_RepeatPeriod);
|
||||
m_Callback();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user