diff --git a/DnsServerCore/DnsServer.cs b/DnsServerCore/DnsServer.cs index b07a4046..fe086162 100644 --- a/DnsServerCore/DnsServer.cs +++ b/DnsServerCore/DnsServer.cs @@ -754,9 +754,22 @@ namespace DnsServerCore _state = ServiceState.Stopping; for (int i = 0; i < UDP_LISTENER_THREAD_COUNT; i++) - _udpListenerThreads[i].Abort(); + { + try + { + _udpListenerThreads[i].Abort(); + } + catch (PlatformNotSupportedException) + { } + } - _tcpListenerThread.Abort(); + + try + { + _tcpListenerThread.Abort(); + } + catch (PlatformNotSupportedException) + { } _udpListener.Dispose(); _tcpListener.Dispose(); diff --git a/DnsServerCore/DnsWebService.cs b/DnsServerCore/DnsWebService.cs index fb561288..fd40eb83 100644 --- a/DnsServerCore/DnsWebService.cs +++ b/DnsServerCore/DnsWebService.cs @@ -3259,7 +3259,12 @@ namespace DnsServerCore _state = ServiceState.Stopping; - _webServiceThread.Abort(); + try + { + _webServiceThread.Abort(); + } + catch (PlatformNotSupportedException) + { } _webService.Stop(); _dnsServer.Stop();