mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Fix race condition in TimerUpdateTrigger stop
This commit is contained in:
parent
e332d79a47
commit
1fa466809e
@ -92,13 +92,23 @@ namespace RGB.NET.Core
|
|||||||
if (UpdateTask != null)
|
if (UpdateTask != null)
|
||||||
{
|
{
|
||||||
UpdateTokenSource?.Cancel();
|
UpdateTokenSource?.Cancel();
|
||||||
|
try
|
||||||
|
{
|
||||||
// ReSharper disable once MethodSupportsCancellation
|
// ReSharper disable once MethodSupportsCancellation
|
||||||
UpdateTask.Wait();
|
UpdateTask.Wait();
|
||||||
|
}
|
||||||
|
catch (AggregateException)
|
||||||
|
{
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
UpdateTask.Dispose();
|
UpdateTask.Dispose();
|
||||||
UpdateTask = null;
|
UpdateTask = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void UpdateLoop()
|
private void UpdateLoop()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user