remove item from schematic's connection graph on destruction

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17961
This commit is contained in:
Petri Hodju 2024-05-13 20:41:31 +00:00 committed by Seth Hillbrand
parent 086e609c3d
commit 4920c6b00b
1 changed files with 6 additions and 0 deletions

View File

@ -34,6 +34,7 @@
#include <sch_edit_frame.h>
#include <schematic.h>
#include <symbol.h>
#include <connection_graph.h>
#include <trace_helpers.h>
#include <general.h>
#include <netclass.h>
@ -114,6 +115,11 @@ SCH_ITEM::~SCH_ITEM()
{
for( const auto& it : m_connection_map )
delete it.second;
SCHEMATIC* sch = Schematic();
if( sch != nullptr )
sch->ConnectionGraph()->RemoveItem( this );
}