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;
|
return true;
|
||||||
|
|
||||||
// No MDI yet
|
// No MDI yet
|
||||||
if( aSetActive && !m_projects.empty() && !UnloadProject( m_projects.begin()->second.get() ) )
|
if( aSetActive && !m_projects.empty() )
|
||||||
return false;
|
{
|
||||||
|
PROJECT* oldProject = m_projects.begin()->second.get();
|
||||||
|
unloadProjectFile( oldProject, true );
|
||||||
|
m_projects.erase( m_projects.begin() );
|
||||||
|
}
|
||||||
|
|
||||||
wxLogTrace( traceSettings, "Load project %s", fullPath );
|
wxLogTrace( traceSettings, "Load project %s", fullPath );
|
||||||
|
|
||||||
|
|
|
@ -1179,6 +1179,9 @@ void TREE_PROJECT_FRAME::FileWatcherReset()
|
||||||
#else
|
#else
|
||||||
m_watcher->Add( fn );
|
m_watcher->Add( fn );
|
||||||
|
|
||||||
|
if( m_TreeProject->IsEmpty() )
|
||||||
|
return;
|
||||||
|
|
||||||
// Add subdirs
|
// Add subdirs
|
||||||
wxTreeItemIdValue cookie;
|
wxTreeItemIdValue cookie;
|
||||||
wxTreeItemId root_id = m_root;
|
wxTreeItemId root_id = m_root;
|
||||||
|
|
Loading…
Reference in New Issue