mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
UI: Cancel loaders on shutdown.
Improves backend switching / locking / etc. performance when the recent list has games that aren't currently available. Also, remove unnecessary duplicate gameinfo flush on EGL loop shutdown. Already happens in NativeShutdownGraphics().
This commit is contained in:
parent
ee5b68f1fc
commit
2943bbdbfd
@ -674,6 +674,8 @@ void GameInfoCache::Init() {
|
||||
}
|
||||
|
||||
void GameInfoCache::Shutdown() {
|
||||
CancelAll();
|
||||
|
||||
if (gameInfoWQ_) {
|
||||
StopProcessingWorkQueue(gameInfoWQ_);
|
||||
delete gameInfoWQ_;
|
||||
@ -682,6 +684,8 @@ void GameInfoCache::Shutdown() {
|
||||
}
|
||||
|
||||
void GameInfoCache::Clear() {
|
||||
CancelAll();
|
||||
|
||||
if (gameInfoWQ_) {
|
||||
gameInfoWQ_->Flush();
|
||||
gameInfoWQ_->WaitUntilDone();
|
||||
@ -689,6 +693,15 @@ void GameInfoCache::Clear() {
|
||||
info_.clear();
|
||||
}
|
||||
|
||||
void GameInfoCache::CancelAll() {
|
||||
for (auto info : info_) {
|
||||
FileLoader *fl = info.second->GetFileLoader();
|
||||
if (fl) {
|
||||
fl->Cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameInfoCache::FlushBGs() {
|
||||
for (auto iter = info_.begin(); iter != info_.end(); iter++) {
|
||||
std::lock_guard<std::mutex> lock(iter->second->lock);
|
||||
|
@ -173,6 +173,7 @@ public:
|
||||
|
||||
PrioritizedWorkQueue *WorkQueue() { return gameInfoWQ_; }
|
||||
|
||||
void CancelAll();
|
||||
void WaitUntilDone(std::shared_ptr<GameInfo> &info);
|
||||
|
||||
private:
|
||||
|
@ -1171,8 +1171,6 @@ retry:
|
||||
}
|
||||
|
||||
ILOG("Leaving EGL/Vulkan render loop.");
|
||||
if (g_gameInfoCache)
|
||||
g_gameInfoCache->WorkQueue()->Flush();
|
||||
|
||||
NativeShutdownGraphics();
|
||||
renderer_inited = false;
|
||||
|
Loading…
Reference in New Issue
Block a user