From acd49f37652d94955e49de6f88399f54365b846e Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 22 Mar 2020 13:10:28 +1000 Subject: [PATCH] Qt: Fix possible crash when loading state via menu --- src/duckstation-qt/mainwindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 4e94bfdce..6c25a9cf9 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -475,8 +475,11 @@ void MainWindow::connectSignals() &MainWindow::onSystemPerformanceCountersUpdated); connect(m_host_interface, &QtHostInterface::runningGameChanged, this, &MainWindow::onRunningGameChanged); - connect(m_game_list_widget, &GameListWidget::entrySelected, this, &MainWindow::onGameListEntrySelected); - connect(m_game_list_widget, &GameListWidget::entryDoubleClicked, this, &MainWindow::onGameListEntryDoubleClicked); + // These need to be queued connections to stop crashing due to menus opening/closing and switching focus. + connect(m_game_list_widget, &GameListWidget::entrySelected, this, &MainWindow::onGameListEntrySelected, + Qt::QueuedConnection); + connect(m_game_list_widget, &GameListWidget::entryDoubleClicked, this, &MainWindow::onGameListEntryDoubleClicked, + Qt::QueuedConnection); connect(m_game_list_widget, &GameListWidget::entryContextMenuRequested, this, &MainWindow::onGameListContextMenuRequested);