From 1e660c8e8581ed2c82b190bcd17c60b775e470c4 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 8 Sep 2022 10:37:40 +1000 Subject: [PATCH] Qt: Fix possible crash when starting game while scanning --- pcsx2-qt/GameList/GameListWidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pcsx2-qt/GameList/GameListWidget.cpp b/pcsx2-qt/GameList/GameListWidget.cpp index 4412b62fe5..7b8e3f6629 100644 --- a/pcsx2-qt/GameList/GameListWidget.cpp +++ b/pcsx2-qt/GameList/GameListWidget.cpp @@ -246,8 +246,10 @@ void GameListWidget::cancelRefresh() m_refresh_thread->cancel(); m_refresh_thread->wait(); - QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); - pxAssertRel(!m_refresh_thread, "Game list thread should be unreferenced by now"); + + // Cancelling might not be instant if we're say, scanning a gzip dump. Wait until it's done. + while (m_refresh_thread) + QApplication::processEvents(QEventLoop::ExcludeUserInputEvents, 1); } void GameListWidget::refreshImages()