Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions rpcs3/rpcs3qt/game_list_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ void game_list_frame::LoadSettings()
}

game_list_frame::~game_list_frame()
{
StopAllThreads();
}

void game_list_frame::StopAllThreads()
{
WaitAndAbortSizeCalcThreads();
WaitAndAbortRepaintThreads();
Expand Down
2 changes: 2 additions & 0 deletions rpcs3/rpcs3qt/game_list_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class game_list_frame : public custom_dock_widget
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);
~game_list_frame();

void StopAllThreads();

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

Expand Down
7 changes: 7 additions & 0 deletions rpcs3/rpcs3qt/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@ bool main_window::Init([[maybe_unused]] bool with_cli_boot)
ui->menuBar->cornerWidget()->setVisible(update_available);
}
});
connect(&m_updater, &update_manager::signal_about_to_terminate, this, [this]()
{
if (m_game_list_frame)
{
m_game_list_frame->StopAllThreads();
}
});

#ifdef RPCS3_UPDATE_SUPPORTED
if (const auto update_value = m_gui_settings->GetValue(gui::m_check_upd_start).toString(); update_value != gui::update_off)
Expand Down
2 changes: 2 additions & 0 deletions rpcs3/rpcs3qt/update_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,8 @@ bool update_manager::handle_rpcs3(const QByteArray& data, bool auto_accept)
m_gui_settings->sync(); // Make sure to sync before terminating RPCS3
}

Q_EMIT signal_about_to_terminate();

Emu.GracefulShutdown(false);
Emu.CleanUp();

Expand Down
1 change: 1 addition & 0 deletions rpcs3/rpcs3qt/update_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ class update_manager final : public QObject

Q_SIGNALS:
void signal_update_available(bool update_available);
void signal_about_to_terminate();
};