diff options
| author | Liam <byteslice@airmail.cc> | 2023-10-12 21:07:49 -0400 |
|---|---|---|
| committer | Liam <byteslice@airmail.cc> | 2023-10-12 21:07:49 -0400 |
| commit | faa6c35e78dd0c843de15e08e91211625bb1df67 (patch) | |
| tree | d9197e8b25c0c99b627655a1c104eb4eb694e5f2 /src/yuzu/game_list_worker.cpp | |
| parent | 519c12da1566e03b87cd1066999ed673ade30608 (diff) | |
qt: ensure worker cancellation is complete before clearing
Diffstat (limited to 'src/yuzu/game_list_worker.cpp')
| -rw-r--r-- | src/yuzu/game_list_worker.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index 588f1dd6e..077ced12b 100644 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp @@ -293,7 +293,7 @@ void GameListWorker::AddTitlesToGameList(GameListDir* parent_dir) { void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_path, bool deep_scan, GameListDir* parent_dir) { const auto callback = [this, target, parent_dir](const std::filesystem::path& path) -> bool { - if (stop_processing) { + if (stop_requested) { // Breaks the callback loop. return false; } @@ -399,7 +399,6 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa } void GameListWorker::run() { - stop_processing = false; provider->ClearAllEntries(); for (UISettings::GameDir& game_dir : game_dirs) { @@ -427,9 +426,11 @@ void GameListWorker::run() { } emit Finished(watch_list); + processing_completed.Set(); } void GameListWorker::Cancel() { this->disconnect(); - stop_processing = true; + stop_requested.store(true); + processing_completed.Wait(); } |
