From efee5f0cb3038b49a7769c35407bce4e0b7c85ca Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Sat, 25 May 2024 16:25:44 -0700 Subject: [PATCH] properly dispose everything when disposing the imgui resource cache --- src/BizHawk.Bizware.Graphics/ImGuiResourceCache.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Bizware.Graphics/ImGuiResourceCache.cs b/src/BizHawk.Bizware.Graphics/ImGuiResourceCache.cs index fb06d7c837..150177a4d3 100644 --- a/src/BizHawk.Bizware.Graphics/ImGuiResourceCache.cs +++ b/src/BizHawk.Bizware.Graphics/ImGuiResourceCache.cs @@ -76,9 +76,10 @@ namespace BizHawk.Bizware.Graphics public void Dispose() { - foreach (var cachedTexture in TextureCache.Values) + foreach (var cache in TextureCache) { - cachedTexture.Dispose(); + cache.Key.Dispose(); + cache.Value.Dispose(); } foreach (var cachedBrush in BrushCache.Values)