aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/ConnectionWatchdog.cs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/slskd/Core/ConnectionWatchdog.cs b/src/slskd/Core/ConnectionWatchdog.cs
index 9964514b..5001f024 100644
--- a/src/slskd/Core/ConnectionWatchdog.cs
+++ b/src/slskd/Core/ConnectionWatchdog.cs
@@ -233,7 +233,18 @@ namespace slskd
}
finally
{
- CancellationTokenSource?.Dispose();
+ var cts = CancellationTokenSource;
+ CancellationTokenSource = null;
+
+ try
+ {
+ cts?.Dispose();
+ }
+ catch (Exception)
+ {
+ // noop. i don't think this can throw, but if we fail to release the SyncRoot we'll be in trouble.
+ }
+
SyncRoot.Release();
}
}