| 775 | } |
| 776 | |
| 777 | void MainWindow::quit() |
| 778 | { |
| 779 | // Make sure VM is gone. It really should be if we're here. |
| 780 | if (s_vm_valid) |
| 781 | { |
| 782 | g_emu_thread->shutdownVM(false); |
| 783 | while (s_vm_valid) |
| 784 | QApplication::processEvents(QEventLoop::ExcludeUserInputEvents, 1); |
| 785 | } |
| 786 | |
| 787 | // Big picture might still be active. |
| 788 | if (m_display_created) |
| 789 | g_emu_thread->stopFullscreenUI(); |
| 790 | |
| 791 | // Ensure subwindows are removed before quitting. That way the log window cancelling |
| 792 | // the close event won't cancel the quit process. |
| 793 | destroySubWindows(); |
| 794 | QGuiApplication::quit(); |
| 795 | } |
| 796 | |
| 797 | void MainWindow::destroySubWindows() |
| 798 | { |
no test coverage detected