summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorMichael Maltese <michaeljosephmaltese@gmail.com>2017-05-31 21:11:54 -0700
committerMichael Maltese <michaeljosephmaltese@gmail.com>2017-05-31 21:14:55 -0700
commit040bddafa6e97ab18b9f96436b05d5df885bbae6 (patch)
treecb9ac7a92e5ef5b14847ebae90deaf85c96bbaec /Source/Core
parent6dc3b2e8bcdb3073cf6d45af50186def432c75e8 (diff)
MainWindow: shutdown different input interfaces
`MainWindow` initializes a number of input interfaces but never shuts them down. This was causing a crash-after-exit on macOS where the ControllerInterface backend stores a `std::thread` object in a static variable and only stops it when ControllerInterface::Shutdown is called.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt2/MainWindow.cpp10
-rw-r--r--Source/Core/DolphinQt2/MainWindow.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp
index d60c0ac415..c003f5be04 100644
--- a/Source/Core/DolphinQt2/MainWindow.cpp
+++ b/Source/Core/DolphinQt2/MainWindow.cpp
@@ -52,6 +52,7 @@ MainWindow::MainWindow() : QMainWindow(nullptr)
MainWindow::~MainWindow()
{
m_render_widget->deleteLater();
+ ShutdownControllers();
}
void MainWindow::InitControllers()
@@ -66,6 +67,15 @@ void MainWindow::InitControllers()
HotkeyManagerEmu::Initialize();
}
+void MainWindow::ShutdownControllers()
+{
+ g_controller_interface.Shutdown();
+ Pad::Shutdown();
+ Keyboard::Shutdown();
+ Wiimote::Shutdown();
+ HotkeyManagerEmu::Shutdown();
+}
+
void MainWindow::CreateComponents()
{
m_menu_bar = new MenuBar(this);
diff --git a/Source/Core/DolphinQt2/MainWindow.h b/Source/Core/DolphinQt2/MainWindow.h
index c2917c1ac0..cc617c3ac0 100644
--- a/Source/Core/DolphinQt2/MainWindow.h
+++ b/Source/Core/DolphinQt2/MainWindow.h
@@ -66,6 +66,7 @@ private:
void ConnectPathsDialog();
void InitControllers();
+ void ShutdownControllers();
void StartGame(const QString& path);
void ShowRenderWidget();