From 89c7a42094dde75e0bac9f84994a20c8f481bfb9 Mon Sep 17 00:00:00 2001 From: yuzubot Date: Wed, 21 Feb 2024 13:47:11 +0000 Subject: [PATCH] Merge yuzu-emu#13000 --- src/core/device_memory_manager.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/device_memory_manager.inc b/src/core/device_memory_manager.inc index 37c1e69c3..f104d495b 100644 --- a/src/core/device_memory_manager.inc +++ b/src/core/device_memory_manager.inc @@ -522,13 +522,17 @@ void DeviceMemoryManager::UpdatePagesCachedCount(DAddr addr, size_t size auto* memory_device_inter = registered_processes[asid.id]; const auto release_pending = [&] { if (uncache_bytes > 0) { - MarkRegionCaching(memory_device_inter, uncache_begin << Memory::YUZU_PAGEBITS, - uncache_bytes, false); + if (memory_device_inter != nullptr) { + MarkRegionCaching(memory_device_inter, uncache_begin << Memory::YUZU_PAGEBITS, + uncache_bytes, false); + } uncache_bytes = 0; } if (cache_bytes > 0) { - MarkRegionCaching(memory_device_inter, cache_begin << Memory::YUZU_PAGEBITS, - cache_bytes, true); + if (memory_device_inter != nullptr) { + MarkRegionCaching(memory_device_inter, cache_begin << Memory::YUZU_PAGEBITS, + cache_bytes, true); + } cache_bytes = 0; } };