mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-06 12:45:21 +02: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user