Fix unwanted bitmap disposing

This commit is contained in:
CasualPokePlayer 2024-05-25 16:24:40 -07:00
parent d6fda19d2e
commit 3716a65638
1 changed files with 3 additions and 2 deletions

View File

@ -106,8 +106,9 @@ namespace BizHawk.Bizware.Graphics
switch (gcHandle.Target)
{
case ImGuiUserTexture userTexture:
// avoid disposing our string output bitmap here
if (userTexture.Bitmap != _stringOutput)
// only dispose anything not cached somewhere
if (userTexture.Bitmap != _stringOutput
&& !_resourceCache.TextureCache.ContainsKey(userTexture.Bitmap))
{
userTexture.Bitmap.Dispose();
}