diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index 187a435d3c..dc9739aab5 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -935,6 +935,14 @@ void GameInfoCache::Clear() { CancelAll(); std::lock_guard lock(mapLock_); + // NOTE: Some shared_pointers might have other owners. We still need to wipe their textures here. + for (auto &[key, value] : info_) { + std::lock_guard lock(value->lock); + value->pic0.Clear(); + value->pic1.Clear(); + value->icon.Clear(); + value->hasFlags &= ~(GameInfoFlags::PIC0 | GameInfoFlags::PIC1 | GameInfoFlags::ICON); + } info_.clear(); }