Progress Dialog: Fix race on PPU compilation status

This commit is contained in:
Eladash 2023-08-21 19:14:21 +03:00 committed by Elad Ashkenazi
parent 36dce454dd
commit a001e6ef09
6 changed files with 74 additions and 15 deletions

View file

@ -2678,7 +2678,7 @@ void Emulator::Kill(bool allow_autoexit, bool savestate)
{
// Show visual feedback to the user in case that stopping takes a while.
// This needs to be done before actually stopping, because otherwise the necessary threads will be terminated before we can show an image.
if (auto progress_dialog = g_fxo->try_get<named_thread<progress_dialog_server>>(); progress_dialog && +g_progr)
if (auto progress_dialog = g_fxo->try_get<named_thread<progress_dialog_server>>(); progress_dialog && g_progr.load())
{
// We are currently showing a progress dialog. Notify it that we are going to stop emulation.
g_system_progress_stopping = true;