Free item memory when closing schematic window

This fires the dtor for each item on the screen, allowing us to properly
close and remove them from the connection graph

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17961
This commit is contained in:
Seth Hillbrand 2024-05-16 09:57:20 -07:00
parent f61ee3ff4b
commit 9fbda137cb
1 changed files with 1 additions and 1 deletions

View File

@ -1097,7 +1097,7 @@ void SCH_EDIT_FRAME::doCloseWindow()
if( !Schematic().GetFileName().IsEmpty() && !Schematic().RootScreen()->IsEmpty() ) if( !Schematic().GetFileName().IsEmpty() && !Schematic().RootScreen()->IsEmpty() )
UpdateFileHistory( fileName ); UpdateFileHistory( fileName );
Schematic().RootScreen()->Clear(); Schematic().RootScreen()->Clear( true );
// all sub sheets are deleted, only the main sheet is usable // all sub sheets are deleted, only the main sheet is usable
GetCurrentSheet().clear(); GetCurrentSheet().clear();