Browse Source

CriticalSection now removes its message hook handler on exit

pull/46/head
Anairkoen Schno 4 years ago
parent
commit
5799d7492e
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      IPA.Loader/Utilities/CriticalSection.cs

+ 9
- 0
IPA.Loader/Utilities/CriticalSection.cs View File

@ -18,9 +18,18 @@ namespace IPA.Utilities
{
Logger.log.Debug("Configuring exit handlers");
AppDomain.CurrentDomain.ProcessExit -= Reset;
AppDomain.CurrentDomain.ProcessExit += Reset;
ResetExitHandlers();
}
private static void Reset(object sender, EventArgs e)
{
Win32.SetConsoleCtrlHandler(registeredHandler, false);
WinHttp.SetPeekMessageHook(null);
}
#region Execute section
private static readonly Win32.ConsoleCtrlDelegate registeredHandler = HandleExit;


Loading…
Cancel
Save