Skip to content

Commit e752e66

Browse files
committed
Qt: stop all game list threads before updating
1 parent ff21a05 commit e752e66

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

rpcs3/rpcs3qt/game_list_frame.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ void game_list_frame::LoadSettings()
229229
}
230230

231231
game_list_frame::~game_list_frame()
232+
{
233+
StopAllThreads();
234+
}
235+
236+
void game_list_frame::StopAllThreads()
232237
{
233238
WaitAndAbortSizeCalcThreads();
234239
WaitAndAbortRepaintThreads();

rpcs3/rpcs3qt/game_list_frame.h

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class game_list_frame : public custom_dock_widget
3535
explicit game_list_frame(std::shared_ptr<gui_settings> gui_settings, std::shared_ptr<emu_settings> emu_settings, std::shared_ptr<persistent_settings> persistent_settings, QWidget* parent = nullptr);
3636
~game_list_frame();
3737

38+
void StopAllThreads();
39+
3840
/** Refresh the gamelist with/without loading game data from files. Public so that main frame can refresh after vfs or install */
3941
void Refresh(const bool from_drive = false, const std::vector<std::string>& serials_to_remove_from_yml = {}, const bool scroll_after = true);
4042

rpcs3/rpcs3qt/main_window.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,13 @@ bool main_window::Init([[maybe_unused]] bool with_cli_boot)
307307
ui->menuBar->cornerWidget()->setVisible(update_available);
308308
}
309309
});
310+
connect(&m_updater, &update_manager::signal_about_to_terminate, this, [this]()
311+
{
312+
if (m_game_list_frame)
313+
{
314+
m_game_list_frame->StopAllThreads();
315+
}
316+
});
310317

311318
#ifdef RPCS3_UPDATE_SUPPORTED
312319
if (const auto update_value = m_gui_settings->GetValue(gui::m_check_upd_start).toString(); update_value != gui::update_off)

rpcs3/rpcs3qt/update_manager.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ bool update_manager::handle_rpcs3(const QByteArray& data, bool auto_accept)
755755
m_gui_settings->sync(); // Make sure to sync before terminating RPCS3
756756
}
757757

758+
Q_EMIT signal_about_to_terminate();
759+
758760
Emu.GracefulShutdown(false);
759761
Emu.CleanUp();
760762

rpcs3/rpcs3qt/update_manager.h

+1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ class update_manager final : public QObject
4545

4646
Q_SIGNALS:
4747
void signal_update_available(bool update_available);
48+
void signal_about_to_terminate();
4849
};

0 commit comments

Comments
 (0)