Browse Source

CriticalSection now removes its message hook handler on exit

4.0.0-beta
Anairkoen Schno 5 years ago
parent
commit
a5e32b52e6
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