From ab5240d8d2e452ac4e0a434b353080a5c3a7e963 Mon Sep 17 00:00:00 2001 From: squidbus <175574877+squidbus@users.noreply.github.com> Date: Sun, 22 Dec 2024 06:31:59 -0800 Subject: [PATCH] qt: Do not run emulator on separate thread on Mac. (#1849) --- src/qt_gui/main_window.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index 39f7c7b9..adb42fc2 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -1098,10 +1098,16 @@ void MainWindow::StartEmulator(std::filesystem::path path) { QMessageBox::critical(nullptr, tr("Run Game"), QString(tr("Game is already running!"))); return; } + isGameRunning = true; +#ifdef __APPLE__ + // SDL on macOS requires main thread. + Core::Emulator emulator; + emulator.Run(path); +#else std::thread emulator_thread([=] { Core::Emulator emulator; emulator.Run(path); }); emulator_thread.detach(); - isGameRunning = true; +#endif }