From 58f72ce9ba96929e672c8384e9d4fb77a67b1e57 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 1 May 2021 13:53:23 +0530 Subject: [PATCH] LogManager: fixed issue that would set queue cancellation token even when logging is stopped causing the logging thread to block when enabling again. --- DnsServerCore/LogManager.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DnsServerCore/LogManager.cs b/DnsServerCore/LogManager.cs index 04d4ff02..2c9c2755 100644 --- a/DnsServerCore/LogManager.cs +++ b/DnsServerCore/LogManager.cs @@ -247,7 +247,8 @@ namespace DnsServerCore { try { - _queueCancellationTokenSource.Cancel(); + if (_logOut != null) + _queueCancellationTokenSource.Cancel(); lock (_logFileLock) { @@ -560,7 +561,8 @@ namespace DnsServerCore { try { - _queueCancellationTokenSource.Cancel(); + if (_logOut != null) + _queueCancellationTokenSource.Cancel(); lock (_logFileLock) {