Just unsubscribe instead of misleading dispose
MODIFY
WalletWasabi/Services/Terminate/TerminateService.cs
WalletWasabi/Services/Terminate/TerminateService.cs
@@ -72,10 +72,12 @@ namespace WalletWasabi.Services.Terminate
}
resetEvent.Set();
- }));
+ });
+
resetEvent.WaitOne();
- Dispose();
+ AppDomain.CurrentDomain.ProcessExit -= CurrentDomain_ProcessExit;
+ Console.CancelKeyPress -= Console_CancelKeyPress;
// Indicate that the termination procedure finished. So other callers can return.
Interlocked.Exchange(ref _terminateStatus, TerminateFinished);
@@ -84,11 +86,5 @@ namespace WalletWasabi.Services.Terminate
}
public bool IsTerminateRequested => Interlocked.Read(ref _terminateStatus) > TerminateStatusIdle;
-
- private void Dispose()
- {
- AppDomain.CurrentDomain.ProcessExit -= CurrentDomain_ProcessExit;
- Console.CancelKeyPress -= Console_CancelKeyPress;
- }
}
}

Just unsubscribe instead of misleading dispose