diff --git a/cvpcb/cvpcb.cpp b/cvpcb/cvpcb.cpp index 3d24dd0067..301e0bd7e7 100644 --- a/cvpcb/cvpcb.cpp +++ b/cvpcb/cvpcb.cpp @@ -184,6 +184,9 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits ) } catch( const IO_ERROR& ioe ) { + // we didnt get anywhere deregister the settings + aProgram->GetSettingsManager().FlushAndRelease( KifaceSettings(), false ); + DisplayErrorMessage( nullptr, _( "An error occurred attempting to load the global " "footprint library table." ), ioe.What() ); diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index f7ee199104..f90979f05d 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -334,7 +334,8 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits ) InitSettings( new EESCHEMA_SETTINGS ); // Register the symbol editor settings as well because they share a KiFACE and need to be // loaded prior to use to avoid threading deadlocks - aProgram->GetSettingsManager().RegisterSettings( new SYMBOL_EDITOR_SETTINGS ); + SYMBOL_EDITOR_SETTINGS* symSettings = new SYMBOL_EDITOR_SETTINGS(); + aProgram->GetSettingsManager().RegisterSettings( symSettings ); // manager takes ownership // We intentionally register KifaceSettings after SYMBOL_EDITOR_SETTINGS // In legacy configs, many settings were in a single editor config nd the migration routine @@ -345,7 +346,12 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits ) start_common( aCtlBits ); if( !loadGlobalLibTable() ) + { + // we didnt get anywhere deregister the settings + aProgram->GetSettingsManager().FlushAndRelease( symSettings, false ); + aProgram->GetSettingsManager().FlushAndRelease( KifaceSettings(), false ); return false; + } m_jobHandler = std::make_unique(); diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index 7ed364eadc..c8d8bff9a8 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -364,7 +364,21 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits ) start_common( aCtlBits ); if( !loadGlobalLibTable() ) + { + // we didnt get anywhere deregister the + aProgram->GetSettingsManager().FlushAndRelease( + aProgram->GetSettingsManager().GetAppSettings(), false ); + + aProgram->GetSettingsManager().FlushAndRelease( KifaceSettings(), false ); + + aProgram->GetSettingsManager().FlushAndRelease( + aProgram->GetSettingsManager().GetAppSettings(), false ); + + aProgram->GetSettingsManager().FlushAndRelease( + aProgram->GetSettingsManager().GetAppSettings(), false ); + return false; + } m_jobHandler = std::make_unique();