From 85544d109ca81e14e0f61773d80bf4dd5e912900 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sun, 26 Feb 2023 17:44:09 -0500 Subject: [PATCH] Don't destroy the DIALOG_PCM_PROGRESS until after the threads actually terminated (cherry picked from commit 47cf26f047f49564d059bc0cbe9fff92e8f6c2b5) --- kicad/pcm/pcm_task_manager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kicad/pcm/pcm_task_manager.cpp b/kicad/pcm/pcm_task_manager.cpp index c9c6d6dbe7..4bdab11571 100644 --- a/kicad/pcm/pcm_task_manager.cpp +++ b/kicad/pcm/pcm_task_manager.cpp @@ -642,13 +642,16 @@ void PCM_TASK_MANAGER::RunQueue( wxWindow* aParent ) } ); 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.reset(); aParent->Raise(); - - download_thread.join(); - install_thread.join(); }