From cf9ccea70b029a591a57767e4504fefc66fa9ec7 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Wed, 22 Feb 2023 17:57:31 +0100 Subject: [PATCH] texcache: unprotect vram immediately even if actual Delete is delayed Fixes MINIDUMP-A5, MINIDUMP-AF --- core/rend/TexCache.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/rend/TexCache.cpp b/core/rend/TexCache.cpp index e67d6a064..abac1c982 100644 --- a/core/rend/TexCache.cpp +++ b/core/rend/TexCache.cpp @@ -453,11 +453,11 @@ void BaseTextureCacheData::unprotectVRam() bool BaseTextureCacheData::Delete() { + unprotectVRam(); + if (custom_load_in_progress > 0) return false; - unprotectVRam(); - free(custom_image_data); custom_image_data = nullptr; @@ -625,6 +625,7 @@ void BaseTextureCacheData::Update() else { WARN_LOG(RENDERER, "Warning: invalid texture. Address %08X %08X size %d", sa_tex, sa, size); + unprotectVRam(); return; } }