Fixed Windows OS exception on async cancel.
Specifically, ObjectDisposedException: Safe handle has been closed.
This commit is contained in:
parent
78e9e185c2
commit
a6f4d918cb
@ -110,9 +110,9 @@ namespace GameServiceWarden.Core.Games
|
|||||||
if (!running) throw new InvalidOperationException("Service instance not running.");
|
if (!running) throw new InvalidOperationException("Service instance not running.");
|
||||||
Logger.Log($"\"{ServiceName}\" is stopping.");
|
Logger.Log($"\"{ServiceName}\" is stopping.");
|
||||||
service.ElegantShutdown();
|
service.ElegantShutdown();
|
||||||
|
stopToken.Cancel();
|
||||||
logSender.Close();
|
logSender.Close();
|
||||||
logReceiver.Close();
|
logReceiver.Close();
|
||||||
stopToken.Cancel();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!acceptingTask.Wait(TIMEOUT)) {
|
if (!acceptingTask.Wait(TIMEOUT)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user