Lua - recover from a locked drawing surface exception and log to the console, rather than crash the emulator
This commit is contained in:
parent
b1b94da6ef
commit
307845b3b5
|
@ -711,14 +711,21 @@ TESTEROO:
|
|||
{
|
||||
foreach (var kvp in LuaSurfaceSets)
|
||||
{
|
||||
var surf = PeekLockedLuaSurface(kvp.Key);
|
||||
DisplaySurface surfLocked = null;
|
||||
if (surf == null)
|
||||
surf = surfLocked = LockLuaSurface(kvp.Key);
|
||||
surf.Clear();
|
||||
if(surfLocked != null)
|
||||
UnlockLuaSurface(surfLocked);
|
||||
LuaSurfaceSets[kvp.Key].SetPending(null);
|
||||
try
|
||||
{
|
||||
var surf = PeekLockedLuaSurface(kvp.Key);
|
||||
DisplaySurface surfLocked = null;
|
||||
if (surf == null)
|
||||
surf = surfLocked = LockLuaSurface(kvp.Key);
|
||||
surf.Clear();
|
||||
if (surfLocked != null)
|
||||
UnlockLuaSurface(surfLocked);
|
||||
LuaSurfaceSets[kvp.Key].SetPending(null);
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -52,8 +52,15 @@ namespace BizHawk.Client.EmuHawk
|
|||
)]
|
||||
public void DrawNew(string name)
|
||||
{
|
||||
DrawFinish();
|
||||
_luaSurface = GlobalWin.DisplayManager.LockLuaSurface(name);
|
||||
try
|
||||
{
|
||||
DrawFinish();
|
||||
_luaSurface = GlobalWin.DisplayManager.LockLuaSurface(name);
|
||||
}
|
||||
catch (InvalidOperationException ex)
|
||||
{
|
||||
Log(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawFinish()
|
||||
|
|
Loading…
Reference in New Issue