From 2dc6adc03897e13e820449402aa26ff62d1f013b Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 9 Jun 2021 23:53:36 +0200 Subject: [PATCH] Qt: fix possible race in RepaintIcons This might also improve performance while scrubbing the icon size slider --- rpcs3/rpcs3qt/game_list_frame.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 7c1cce41f5..2274693d72 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -2014,6 +2014,12 @@ void game_list_frame::ResizeIcons(const int& slider_pos) void game_list_frame::RepaintIcons(const bool& from_settings) { + if (m_repaint_watcher.isRunning()) + { + m_repaint_watcher.cancel(); + m_repaint_watcher.waitForFinished(); + } + if (from_settings) { if (m_gui_settings->GetValue(gui::m_enableUIColors).toBool()) @@ -2051,12 +2057,6 @@ void game_list_frame::RepaintIcons(const bool& from_settings) m_game_list->resizeColumnToContents(gui::column_count - 1); } - if (m_repaint_watcher.isRunning()) - { - m_repaint_watcher.cancel(); - m_repaint_watcher.waitForFinished(); - } - const std::function func = [this](const game_info& game) -> movie_item* { if (game->icon.isNull() && (game->info.icon_path.empty() || !game->icon.load(qstr(game->info.icon_path))))