Clean up stale nested settings when changing project pointer

This commit is contained in:
Jon Evans 2020-07-02 23:55:46 -04:00
parent 498fa8d8ba
commit 1c72042fc4
1 changed files with 11 additions and 0 deletions

View File

@ -69,6 +69,17 @@ void SCHEMATIC::Reset()
void SCHEMATIC::SetProject( PROJECT* aPrj )
{
if( m_project )
{
PROJECT_FILE& project = m_project->GetProjectFile();
delete project.m_ErcSettings;
delete project.m_SchematicSettings;
project.m_ErcSettings = nullptr;
project.m_SchematicSettings = nullptr;
}
m_project = aPrj;
if( m_project )