Fix crash on exit when using XAudio2 with the debugger attached.

This commit is contained in:
J.D. Purcell 2017-04-07 22:57:01 -04:00
parent 681ec8317e
commit 5446a636ba
1 changed files with 11 additions and 2 deletions

View File

@ -225,6 +225,15 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.ExitCode = mf.ProgramRunLoop();
}
}
if (GlobalWin.Sound != null)
{
GlobalWin.Sound.Dispose();
GlobalWin.Sound = null;
}
GlobalWin.GL.Dispose();
#if WINDOWS
GamePad.CloseAll();
#endif
}
else
{ // Display error message windows
@ -288,7 +297,6 @@ namespace BizHawk.Client.EmuHawk
{
new ExceptionBox(e).ShowDialog();
}
#if WINDOWS
finally
{
if (GlobalWin.Sound != null)
@ -297,9 +305,10 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.Sound = null;
}
GlobalWin.GL.Dispose();
#if WINDOWS
GamePad.CloseAll();
}
#endif
}
}
//cleanup: