diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 496fef30b1..8111932b09 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -10,6 +10,7 @@ #include "Emu/System.h" #include "Loader/PSF.h" #include "Utilities/types.h" +#include "Utilities/lockless.h" #include #include @@ -455,6 +456,8 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter) for (size_t i = 0; i < path_list.size(); ++i) indices.append(i); + lf_queue games; + QtConcurrent::blockingMap(indices, [&](size_t& i) { const std::string dir = path_list[i]; @@ -537,7 +540,7 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter) const QColor color = getGridCompatibilityColor(compat.color); const QPixmap pxmap = PaintedPixmap(icon, hasCustomConfig, hasCustomPadConfig, color); - m_game_data.push_back(game_info(new gui_game_info{ game, compat, icon, pxmap, hasCustomConfig, hasCustomPadConfig })); + games.push(std::make_shared(gui_game_info{game, compat, icon, pxmap, hasCustomConfig, hasCustomPadConfig})); } catch (const std::exception& e) { @@ -546,6 +549,11 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter) } }); + for (auto&& g : games.pop_all()) + { + m_game_data.push_back(std::move(g)); + } + // Try to update the app version for disc games if there is a patch for (const auto& entry : m_game_data) {