diff --git a/src/Tgstation.Server.Host/Components/Chat/ChatTrackingContext.cs b/src/Tgstation.Server.Host/Components/Chat/ChatTrackingContext.cs index 369ccdeeeb..03c9ee2e54 100644 --- a/src/Tgstation.Server.Host/Components/Chat/ChatTrackingContext.cs +++ b/src/Tgstation.Server.Host/Components/Chat/ChatTrackingContext.cs @@ -16,7 +16,7 @@ namespace Tgstation.Server.Host.Components.Chat /// public bool Active { - get => active; + get => active && onDispose != null; set { if (active == value) diff --git a/src/Tgstation.Server.Host/Components/Session/SessionController.cs b/src/Tgstation.Server.Host/Components/Session/SessionController.cs index d3feab14a6..9094cdf527 100644 --- a/src/Tgstation.Server.Host/Components/Session/SessionController.cs +++ b/src/Tgstation.Server.Host/Components/Session/SessionController.cs @@ -337,9 +337,8 @@ namespace Tgstation.Server.Host.Components.Session Logger.LogTrace("Disposing..."); - // yield then acquire the topic semaphore to prevent new calls from starting - await Task.Yield(); - (await topicSendSemaphore.Lock(CancellationToken.None)).Dispose(); // DCT: None available + reattachTopicCts.Cancel(); + var semaphoreLockTask = topicSendSemaphore.Lock(CancellationToken.None); // DCT: None available if (!released) { @@ -363,6 +362,7 @@ namespace Tgstation.Server.Host.Components.Session if (!released) await Lifetime; // finish the async callback + (await semaphoreLockTask).Dispose(); topicSendSemaphore.Dispose(); }