aboutsummaryrefslogtreecommitdiff
path: root/src/citra_qt/main.cpp
diff options
context:
space:
mode:
authorLittleWhite <lw.demoscene@googlemail.com>2015-09-05 12:29:44 +0200
committerLittleWhite <lw.demoscene@googlemail.com>2015-09-07 20:34:39 +0200
commit86e29ac2814be7789370c021eb858558557a7362 (patch)
treeed0855e6e962d979d06e00ee007a26e6c8a7c233 /src/citra_qt/main.cpp
parentf5a49df679ef4d2e0aca2115fb5790d5259aa922 (diff)
Stop emulation when render window is closed
Diffstat (limited to 'src/citra_qt/main.cpp')
-rw-r--r--src/citra_qt/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 11813a2a8a..8dadb44efb 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -251,6 +251,7 @@ void GMainWindow::BootGame(const std::string& filename) {
render_window->moveContext();
emu_thread->start();
+ connect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame()));
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues
connect(emu_thread.get(), SIGNAL(DebugModeEntered()), disasmWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
connect(emu_thread.get(), SIGNAL(DebugModeEntered()), registersWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
@@ -283,6 +284,9 @@ void GMainWindow::ShutdownGame() {
emu_thread->wait();
emu_thread = nullptr;
+ // The emulation is stopped, so closing the window or not does not matter anymore
+ disconnect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame()));
+
// Update the GUI
ui.action_Start->setEnabled(false);
ui.action_Start->setText(tr("Start"));