fix race condition in test of active window from input thread (which was a bad idea in the first place) which can throw null references in unlucky cases (fixes #917)
This commit is contained in:
parent
4704f58ead
commit
60b9825f64
|
@ -414,6 +414,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//WHAT!? WE SHOULD NOT BE SO NAIVELY TOUCHING MAINFORM FROM THE INPUTTHREAD. ITS BUSY RUNNING.
|
||||||
bool swallow = !GlobalWin.MainForm.AllowInput(false);
|
bool swallow = !GlobalWin.MainForm.AllowInput(false);
|
||||||
|
|
||||||
foreach (var ie in _NewEvents)
|
foreach (var ie in _NewEvents)
|
||||||
|
|
|
@ -643,15 +643,15 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
// even more special logic for TAStudio:
|
// even more special logic for TAStudio:
|
||||||
// TODO - implement by event filter in TAStudio
|
// TODO - implement by event filter in TAStudio
|
||||||
if (ActiveForm is TAStudio)
|
var maybeTAStudio = ActiveForm as TAStudio;
|
||||||
|
if (maybeTAStudio != null)
|
||||||
{
|
{
|
||||||
if (yieldAlt)
|
if (yieldAlt)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ts = (TAStudio)ActiveForm;
|
if (maybeTAStudio.IsInMenuLoop)
|
||||||
if (ts.IsInMenuLoop)
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue