From e650ec75052132bb811fdf164538d6182e8e8630 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sat, 4 Mar 2023 23:10:26 +0600 Subject: [PATCH] Fix crashes when exiting emulator in multimonitor modes --- src/qt/qt_main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qt/qt_main.cpp b/src/qt/qt_main.cpp index 29f8af5aa..a41a3e889 100644 --- a/src/qt/qt_main.cpp +++ b/src/qt/qt_main.cpp @@ -138,7 +138,11 @@ main_thread_fn() } is_quit = 1; - QTimer::singleShot(0, QApplication::instance(), []() { QApplication::instance()->quit(); }); + if (gfxcard[1]) { + ui_deinit_monitor(1); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + } + QTimer::singleShot(0, QApplication::instance(), []() { QApplication::processEvents(); QApplication::instance()->quit(); }); } static std::thread *main_thread;