diff --git a/eeschema/bus-wire-junction.cpp b/eeschema/bus-wire-junction.cpp index 528d09d686..fa0175463e 100644 --- a/eeschema/bus-wire-junction.cpp +++ b/eeschema/bus-wire-junction.cpp @@ -74,6 +74,12 @@ static void RemoveBacktracks( DLIST& aWires ) SCH_LINE *line = static_cast( p ); p = line->Next(); + if( line->IsNull() ) + { + delete s_wires.Remove( line ); + continue; + } + if( !last_lines.empty() ) { SCH_LINE* last_line = last_lines[last_lines.size() - 1];