diff --git a/eeschema/sim/sim_plot_panel.cpp b/eeschema/sim/sim_plot_panel.cpp index 964358f03d..f66d4e71d5 100644 --- a/eeschema/sim/sim_plot_panel.cpp +++ b/eeschema/sim/sim_plot_panel.cpp @@ -546,8 +546,8 @@ bool SIM_PLOT_PANEL::DeleteTrace( const wxString& aName ) if( it != m_traces.end() ) { - m_traces.erase( it ); TRACE* trace = it->second; + m_traces.erase( it ); if( CURSOR* cursor = trace->GetCursor() ) DelLayer( cursor, true );