mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-12-25 18:30:06 +00:00
qt: prevent reentrant shutdown
This commit is contained in:
parent
c86e21abe4
commit
cb7f0c2ec3
@ -1785,9 +1785,9 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
|
||||
OnStartGame();
|
||||
}
|
||||
|
||||
void GMainWindow::OnShutdownBegin() {
|
||||
bool GMainWindow::OnShutdownBegin() {
|
||||
if (!emulation_running) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ui->action_Fullscreen->isChecked()) {
|
||||
@ -1799,6 +1799,10 @@ void GMainWindow::OnShutdownBegin() {
|
||||
// Disable unlimited frame rate
|
||||
Settings::values.use_speed_limit.SetValue(true);
|
||||
|
||||
if (system->IsShuttingDown()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
system->SetShuttingDown(true);
|
||||
discord_rpc->Pause();
|
||||
|
||||
@ -1817,6 +1821,8 @@ void GMainWindow::OnShutdownBegin() {
|
||||
ui->action_Pause->setEnabled(false);
|
||||
ui->action_Restart->setEnabled(false);
|
||||
ui->action_Stop->setEnabled(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void GMainWindow::OnShutdownBeginDialog() {
|
||||
@ -3003,9 +3009,10 @@ void GMainWindow::OnStopGame() {
|
||||
return;
|
||||
}
|
||||
|
||||
OnShutdownBegin();
|
||||
if (OnShutdownBegin()) {
|
||||
OnShutdownBeginDialog();
|
||||
}
|
||||
}
|
||||
|
||||
void GMainWindow::OnLoadComplete() {
|
||||
loading_screen->OnLoadComplete();
|
||||
|
@ -336,7 +336,7 @@ private slots:
|
||||
void OnReinitializeKeys(ReinitializeKeyBehavior behavior);
|
||||
void OnLanguageChanged(const QString& locale);
|
||||
void OnMouseActivity();
|
||||
void OnShutdownBegin();
|
||||
bool OnShutdownBegin();
|
||||
void OnShutdownBeginDialog();
|
||||
void OnEmulationStopped();
|
||||
void OnEmulationStopTimeExpired();
|
||||
|
Loading…
Reference in New Issue
Block a user