Fix segfault when discarding changes on open

When opening new schematic, the undo/redo list is invalidated.
CleanupSchematic uses it before presenting the new schematic to the
user, so we need to make sure that old data are not preserved here past
their pointer lifetimes
This commit is contained in:
Seth Hillbrand 2021-09-14 16:41:25 -07:00
parent 4a81e4c945
commit ca6e43d1e1
1 changed files with 1 additions and 0 deletions

View File

@ -152,6 +152,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// unload current project file before loading new
{
ClearUndoRedoList();
SetScreen( nullptr );
m_toolManager->GetTool<EE_INSPECTION_TOOL>()->Reset( TOOL_BASE::MODEL_RELOAD );
CreateScreens();