Don't unload project out from under someone else.
(Can only currently happen if you import settings from the current project, but will happen in even more cases once we do MDI.) Possibly Sentry KICAD-169.
This commit is contained in:
parent
57d3aef4cd
commit
6c5ec288a5
|
@ -154,8 +154,13 @@ void DIALOG_SCHEMATIC_SETUP::onAuxiliaryAction( wxCommandEvent& event )
|
|||
return;
|
||||
|
||||
wxFileName projectFn( importDlg.GetFilePath() );
|
||||
bool alreadyLoaded = false;
|
||||
|
||||
if( !m_frame->GetSettingsManager()->LoadProject( projectFn.GetFullPath(), false ) )
|
||||
if( m_frame->GetSettingsManager()->GetProject( projectFn.GetFullPath() ) )
|
||||
{
|
||||
alreadyLoaded = true;
|
||||
}
|
||||
else if( !m_frame->GetSettingsManager()->LoadProject( projectFn.GetFullPath(), false ) )
|
||||
{
|
||||
wxString msg = wxString::Format( _( "Error importing settings from project:\n"
|
||||
"Project file %s could not be loaded." ),
|
||||
|
@ -203,5 +208,6 @@ void DIALOG_SCHEMATIC_SETUP::onAuxiliaryAction( wxCommandEvent& event )
|
|||
->ImportSettingsFrom( file.m_NetSettings );
|
||||
}
|
||||
|
||||
if( !alreadyLoaded )
|
||||
m_frame->GetSettingsManager()->UnloadProject( otherPrj, false );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue