From 9fbda137cbc29eaf2bcf171f96e218ba971f0bab Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 16 May 2024 09:57:20 -0700 Subject: [PATCH] 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 --- eeschema/sch_edit_frame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index d53e520f95..362b24a95d 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1097,7 +1097,7 @@ void SCH_EDIT_FRAME::doCloseWindow() if( !Schematic().GetFileName().IsEmpty() && !Schematic().RootScreen()->IsEmpty() ) UpdateFileHistory( fileName ); - Schematic().RootScreen()->Clear(); + Schematic().RootScreen()->Clear( true ); // all sub sheets are deleted, only the main sheet is usable GetCurrentSheet().clear();