fiddle with race condition thing some more. uhhh full disclosure, I still got a crash once. Couldnt repro it (as compared to before where it was 100% fully reproducible for me. not sure why though

This commit is contained in:
zeromus 2020-04-23 20:40:16 -04:00
parent 3403ecacb7
commit c5ff7edba9
1 changed files with 4 additions and 3 deletions

View File

@ -29,7 +29,6 @@ namespace BizHawk.Client.EmuHawk
/// <remarks>Initialization is only called once when MainForm loads</remarks>
public static void Initialize()
{
CloseAll();
var playerCount = 0;
for (var i = 0; i < MAX_GAMEPADS; i++)
{
@ -56,7 +55,8 @@ namespace BizHawk.Client.EmuHawk
{
lock (_syncObj)
{
foreach (var device in Devices) device.Update();
if (initialized)
foreach (var device in Devices) device.Update();
}
}
@ -64,7 +64,8 @@ namespace BizHawk.Client.EmuHawk
{
lock (_syncObj)
{
Devices.Clear();
if (!initialized)
throw new InvalidOperationException("Well, however did this happen");
}
}