Merge pull request #5509 from ligfx/qtshutdowncontrollers

MainWindow: shutdown different input interfaces
This commit is contained in:
Leo Lam 2017-06-02 22:08:53 +02:00 committed by GitHub
commit 93020f6c1b
2 changed files with 11 additions and 0 deletions

View File

@ -52,6 +52,7 @@ MainWindow::MainWindow() : QMainWindow(nullptr)
MainWindow::~MainWindow() MainWindow::~MainWindow()
{ {
m_render_widget->deleteLater(); m_render_widget->deleteLater();
ShutdownControllers();
} }
void MainWindow::InitControllers() void MainWindow::InitControllers()
@ -66,6 +67,15 @@ void MainWindow::InitControllers()
HotkeyManagerEmu::Initialize(); HotkeyManagerEmu::Initialize();
} }
void MainWindow::ShutdownControllers()
{
g_controller_interface.Shutdown();
Pad::Shutdown();
Keyboard::Shutdown();
Wiimote::Shutdown();
HotkeyManagerEmu::Shutdown();
}
void MainWindow::CreateComponents() void MainWindow::CreateComponents()
{ {
m_menu_bar = new MenuBar(this); m_menu_bar = new MenuBar(this);

View File

@ -66,6 +66,7 @@ private:
void ConnectPathsDialog(); void ConnectPathsDialog();
void InitControllers(); void InitControllers();
void ShutdownControllers();
void StartGame(const QString& path); void StartGame(const QString& path);
void ShowRenderWidget(); void ShowRenderWidget();