From 08169afbee23b2eedf5e3404d2fa138972e938a1 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 25 Oct 2019 17:55:18 +0200 Subject: [PATCH] PCB_BASE_FRAME::SelectFootprintFromLibTree(): fix annoying issue: the progress reporter was displayed after loading libraries, because it was destroyed too late. --- pcbnew/load_select_footprint.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index cc10462022..738fdfb2c1 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -204,12 +204,15 @@ MODULE* PCB_BASE_FRAME::SelectFootprintFromLibTree( LIB_ID aPreselect ) static wxString lastComponentName; - WX_PROGRESS_REPORTER progressReporter( this, _( "Loading Footprint Libraries" ), 3 ); - GFootprintList.ReadFootprintFiles( fpTable, nullptr, &progressReporter ); - progressReporter.Show( false ); + // Load footprint files: + WX_PROGRESS_REPORTER* progressReporter = new WX_PROGRESS_REPORTER( this, + _( "Loading Footprint Libraries" ), 3 ); + GFootprintList.ReadFootprintFiles( fpTable, nullptr, progressReporter ); + bool cancel = progressReporter->WasCancelled(); + progressReporter->Destroy(); - if( progressReporter.WasCancelled() ) - return NULL; + if( cancel ) + return nullptr; if( GFootprintList.GetErrorCount() ) GFootprintList.DisplayErrors( this );