diff options
| author | 2015-09-14 15:23:08 -0400 | |
|---|---|---|
| committer | 2015-09-14 15:23:08 -0400 | |
| commit | d6e56b8c88b46f4f85f44b26bff00422e31a6e57 (patch) | |
| tree | f476fa88654be86b6d768bfee9b29d5875a17f63 /src/citra_qt/main.cpp | |
| parent | Merge pull request #1152 from lioncash/nullptr (diff) | |
| parent | Stop emulation when render window is closed (diff) | |
| download | yuzu-d6e56b8c88b46f4f85f44b26bff00422e31a6e57.tar.gz yuzu-d6e56b8c88b46f4f85f44b26bff00422e31a6e57.tar.xz yuzu-d6e56b8c88b46f4f85f44b26bff00422e31a6e57.zip | |
Merge pull request #1111 from LittleWhite-tb/qt-close-renderwindow
Stop emulation when render window is closed
Diffstat (limited to 'src/citra_qt/main.cpp')
| -rw-r--r-- | src/citra_qt/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index d2c7459a4..01841b33c 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -252,6 +252,7 @@ void GMainWindow::BootGame(const std::string& filename) { | |||
| 252 | render_window->moveContext(); | 252 | render_window->moveContext(); |
| 253 | emu_thread->start(); | 253 | emu_thread->start(); |
| 254 | 254 | ||
| 255 | connect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame())); | ||
| 255 | // BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues | 256 | // BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views before the CPU continues |
| 256 | connect(emu_thread.get(), SIGNAL(DebugModeEntered()), disasmWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection); | 257 | connect(emu_thread.get(), SIGNAL(DebugModeEntered()), disasmWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection); |
| 257 | connect(emu_thread.get(), SIGNAL(DebugModeEntered()), registersWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection); | 258 | connect(emu_thread.get(), SIGNAL(DebugModeEntered()), registersWidget, SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection); |
| @@ -284,6 +285,9 @@ void GMainWindow::ShutdownGame() { | |||
| 284 | emu_thread->wait(); | 285 | emu_thread->wait(); |
| 285 | emu_thread = nullptr; | 286 | emu_thread = nullptr; |
| 286 | 287 | ||
| 288 | // The emulation is stopped, so closing the window or not does not matter anymore | ||
| 289 | disconnect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame())); | ||
| 290 | |||
| 287 | // Update the GUI | 291 | // Update the GUI |
| 288 | ui.action_Start->setEnabled(false); | 292 | ui.action_Start->setEnabled(false); |
| 289 | ui.action_Start->setText(tr("Start")); | 293 | ui.action_Start->setText(tr("Start")); |