From 6474616c8310a9f2bd42a49e84fbe15e0ae69e1d Mon Sep 17 00:00:00 2001 From: Simon McFarlane Date: Sat, 2 May 2015 23:18:10 -0700 Subject: [PATCH] Qt: Prevent crash when closed by the window manager --- Source/Core/DolphinQt/MainWindow.cpp | 5 +++++ Source/Core/DolphinQt/MainWindow.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index e00a35e5e1..ec619ef22b 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -92,6 +92,11 @@ DMainWindow::~DMainWindow() { } +void DMainWindow::closeEvent(QCloseEvent* ce) +{ + Stop(); +} + // Emulation void DMainWindow::StartGame(const QString filename) diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h index 3808f77e9c..e2ef64f93c 100644 --- a/Source/Core/DolphinQt/MainWindow.h +++ b/Source/Core/DolphinQt/MainWindow.h @@ -63,6 +63,7 @@ private slots: void UpdateIcons(); private: + void closeEvent(QCloseEvent* ce); std::unique_ptr m_ui; DGameTracker* m_game_tracker;