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.
This commit is contained in:
parent
6dc3b2e8bc
commit
040bddafa6
|
@ -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);
|
||||
|
|
|
@ -66,6 +66,7 @@ private:
|
|||
void ConnectPathsDialog();
|
||||
|
||||
void InitControllers();
|
||||
void ShutdownControllers();
|
||||
|
||||
void StartGame(const QString& path);
|
||||
void ShowRenderWidget();
|
||||
|
|
Loading…
Reference in New Issue