Qt: Fix possible crash when starting game while scanning

This commit is contained in:
Connor McLaughlin 2022-09-08 10:37:40 +10:00 committed by refractionpcsx2
parent e8704adc67
commit 1e660c8e85
1 changed files with 4 additions and 2 deletions

View File

@ -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()