Fix latent bugs in SCHEMATIC and SCH_SEXPR_PLUGIN
Noticed after writing the qa test: when loading a file immediately after having loaded a previous one, it was resulting in a nullptr exception.
This commit is contained in:
parent
0f0c5c194b
commit
cf2dc06add
|
@ -455,6 +455,8 @@ SCH_SHEET* SCH_SEXPR_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchema
|
||||||
|
|
||||||
wxASSERT( m_currentPath.size() == 1 ); // only the project path should remain
|
wxASSERT( m_currentPath.size() == 1 ); // only the project path should remain
|
||||||
|
|
||||||
|
m_currentPath.pop(); // Clear the path stack for next call to Load
|
||||||
|
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,8 @@ void SCHEMATIC::Reset()
|
||||||
|
|
||||||
project.m_ErcSettings = nullptr;
|
project.m_ErcSettings = nullptr;
|
||||||
project.m_SchematicSettings = nullptr;
|
project.m_SchematicSettings = nullptr;
|
||||||
|
|
||||||
|
m_project = nullptr; // clear the project, so we don't do this again when setting a new one
|
||||||
}
|
}
|
||||||
|
|
||||||
delete m_rootSheet;
|
delete m_rootSheet;
|
||||||
|
|
Loading…
Reference in New Issue