mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-27 08:13:34 +01:00
Clear the gameinfo cache on device lost.
This commit is contained in:
1 parent
ed1360a478
commit
b88f428a67
4 files changed
+28
-3
No files matched your search
+22
-3
@@ -147,9 +147,7 @@ private:
|
||||
|
||||
|
||||
GameInfoCache::~GameInfoCache() {
|
||||
for (auto iter = info_.begin(); iter != info_.end(); iter++) {
|
||||
delete iter->second;
|
||||
}
|
||||
Clear();
|
||||
}
|
||||
|
||||
void GameInfoCache::Init() {
|
||||
@@ -174,6 +172,27 @@ void GameInfoCache::Decimate() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void GameInfoCache::Clear() {
|
||||
gameInfoWQ_->Flush();
|
||||
for (auto iter = info_.begin(); iter != info_.end(); iter++) {
|
||||
lock_guard lock(iter->second->lock);
|
||||
if (!iter->second->pic0TextureData.empty()) {
|
||||
iter->second->pic0TextureData.clear();
|
||||
}
|
||||
if (iter->second->pic0Texture) {
|
||||
delete iter->second->pic0Texture;
|
||||
iter->second->pic0Texture = 0;
|
||||
}
|
||||
if (!iter->second->pic1TextureData.empty()) {
|
||||
iter->second->pic1TextureData.clear();
|
||||
}
|
||||
if (iter->second->pic1Texture) {
|
||||
delete iter->second->pic1Texture;
|
||||
iter->second->pic1Texture = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameInfoCache::FlushBGs() {
|
||||
for (auto iter = info_.begin(); iter != info_.end(); iter++) {
|
||||
lock_guard lock(iter->second->lock);
|
||||
|
||||
Reference in new issue
Block a user