diff --git a/eeschema/sch_item.cpp b/eeschema/sch_item.cpp index e45862857e..fb937b0e82 100644 --- a/eeschema/sch_item.cpp +++ b/eeschema/sch_item.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -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 ); }