Don't destroy the DIALOG_PCM_PROGRESS until after the threads actually terminated

(cherry picked from commit 47cf26f047)
This commit is contained in:
Marek Roszko 2023-02-26 17:44:09 -05:00 committed by Mark Roszko
parent 4aba595b2b
commit 85544d109c
1 changed files with 6 additions and 3 deletions

View File

@ -642,13 +642,16 @@ void PCM_TASK_MANAGER::RunQueue( wxWindow* aParent )
} ); } );
m_reporter->KeepRefreshing( true ); m_reporter->KeepRefreshing( true );
download_thread.join();
install_thread.join();
// Destroy the reporter only after the threads joined
// Incase the reporter terminated due to cancellation
m_reporter->Destroy(); m_reporter->Destroy();
m_reporter.reset(); m_reporter.reset();
aParent->Raise(); aParent->Raise();
download_thread.join();
install_thread.join();
} }