remove item from schematic's connection graph on destruction
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/17961
(cherry picked from commit 4920c6b00b
)
This commit is contained in:
parent
a9b5b1728a
commit
831d438852
|
@ -33,6 +33,7 @@
|
|||
#include <sch_draw_panel.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <schematic.h>
|
||||
#include <connection_graph.h>
|
||||
#include <trace_helpers.h>
|
||||
#include <general.h>
|
||||
#include <netclass.h>
|
||||
|
@ -88,6 +89,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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue