From dee4938c2b61bea356008043ec0733d70ca0c98c Mon Sep 17 00:00:00 2001 From: chaoticgd <43898262+chaoticgd@users.noreply.github.com> Date: Sat, 18 Jul 2026 15:58:26 +0100 Subject: [PATCH] Qt: Fix logic for resetting the VM when changing discs --- pcsx2-qt/MainWindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pcsx2-qt/MainWindow.cpp b/pcsx2-qt/MainWindow.cpp index 15ab29b9e8..6d21628b48 100644 --- a/pcsx2-qt/MainWindow.cpp +++ b/pcsx2-qt/MainWindow.cpp @@ -3732,8 +3732,6 @@ void MainWindow::doDiscChange(CDVD_SourceType source, const QString& path) reset_system = (message.clickedButton() == reset_button); } - switchToEmulationView(); - g_emu_thread->changeDisc(source, path); if (reset_system) { @@ -3743,6 +3741,11 @@ void MainWindow::doDiscChange(CDVD_SourceType source, const QString& path) else g_emu_thread->resetVM(); } + + // We have to do this after resetting the VM, otherwise the reset would be + // deferred since the VM would be running, and then VMLock::~VMLock would + // trample the reset state with its unpause event. + switchToEmulationView(); } MainWindow::VMLock MainWindow::pauseAndLockVM()