Cleanup DisplayManager.ClearApiHawkSurfaces

This commit is contained in:
YoshiRulz 2021-04-08 16:42:27 +10:00
parent e25121bb79
commit 4d47861296
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 4 additions and 10 deletions

View File

@ -1153,22 +1153,16 @@ namespace BizHawk.Client.EmuHawk
{
try
{
var surf = PeekApiHawkLockedSurface(kvp.Key);
DisplaySurface surfLocked = null;
if (surf == null)
if (PeekApiHawkLockedSurface(kvp.Key) == null)
{
surfLocked = LockApiHawkSurface(kvp.Key, true);
var surfLocked = LockApiHawkSurface(kvp.Key, true);
if (surfLocked != null) UnlockApiHawkSurface(surfLocked);
}
if (surfLocked != null)
{
UnlockApiHawkSurface(surfLocked);
}
_apiHawkSurfaceSets[kvp.Key].SetPending(null);
}
catch (InvalidOperationException)
{
// ignored
}
}
}