Fixed Windows OS exception on async cancel.

Specifically, ObjectDisposedException: Safe handle has been closed.
This commit is contained in:
Harrison Deng 2021-04-10 14:03:13 -05:00
parent 78e9e185c2
commit a6f4d918cb

View File

@ -110,9 +110,9 @@ namespace GameServiceWarden.Core.Games
if (!running) throw new InvalidOperationException("Service instance not running.");
Logger.Log($"\"{ServiceName}\" is stopping.");
service.ElegantShutdown();
stopToken.Cancel();
logSender.Close();
logReceiver.Close();
stopToken.Cancel();
try
{
if (!acceptingTask.Wait(TIMEOUT)) {