From a391144abdca91c841ae05762540a604753886cd Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Sun, 31 May 2020 16:44:22 -0400 Subject: [PATCH] Fix potential concurrency issue when reattaching --- .../Components/Session/SessionController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Session/SessionController.cs b/src/Tgstation.Server.Host/Components/Session/SessionController.cs index 471cbad030..f8740a0034 100644 --- a/src/Tgstation.Server.Host/Components/Session/SessionController.cs +++ b/src/Tgstation.Server.Host/Components/Session/SessionController.cs @@ -241,8 +241,9 @@ namespace Tgstation.Server.Host.Components.Session _ = process.Lifetime.ContinueWith( x => { - if (!disposed) - reattachTopicCts.Cancel(); + lock (synchronizationLock) + if (!disposed) + reattachTopicCts.Cancel(); chatTrackingContext.Active = false; }, TaskScheduler.Current);