Prevent segfault on schematic frame close

We are seeing multiple events firing when closing via the manager frame.
Cleaning up the schematic should only happen once.
This commit is contained in:
Jon Evans 2020-08-11 18:56:47 -04:00
parent d97e519036
commit 433616cbf0
1 changed files with 4 additions and 0 deletions

View File

@ -501,6 +501,10 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent )
if( simFrame && !simFrame->Close() ) // Can close the simulator?
return;
// We may have gotten multiple events; don't clean up twice
if( !Schematic().IsValid() )
return;
SCH_SHEET_LIST sheetlist = Schematic().GetSheets();
if( sheetlist.IsModified() )