Fix project unloading in LoadProject
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5380
This commit is contained in:
parent
0dc0536cbf
commit
cd54ba7b01
|
@ -697,8 +697,12 @@ bool SETTINGS_MANAGER::LoadProject( const wxString& aFullPath, bool aSetActive )
|
|||
return true;
|
||||
|
||||
// No MDI yet
|
||||
if( aSetActive && !m_projects.empty() && !UnloadProject( m_projects.begin()->second.get() ) )
|
||||
return false;
|
||||
if( aSetActive && !m_projects.empty() )
|
||||
{
|
||||
PROJECT* oldProject = m_projects.begin()->second.get();
|
||||
unloadProjectFile( oldProject, true );
|
||||
m_projects.erase( m_projects.begin() );
|
||||
}
|
||||
|
||||
wxLogTrace( traceSettings, "Load project %s", fullPath );
|
||||
|
||||
|
|
|
@ -1179,6 +1179,9 @@ void TREE_PROJECT_FRAME::FileWatcherReset()
|
|||
#else
|
||||
m_watcher->Add( fn );
|
||||
|
||||
if( m_TreeProject->IsEmpty() )
|
||||
return;
|
||||
|
||||
// Add subdirs
|
||||
wxTreeItemIdValue cookie;
|
||||
wxTreeItemId root_id = m_root;
|
||||
|
|
Loading…
Reference in New Issue