From fe608bfcef98df407dd8d5210d3ca6a66e6ad1e9 Mon Sep 17 00:00:00 2001 From: Sylwester Kocjan Date: Wed, 8 Sep 2021 22:56:33 +0200 Subject: [PATCH] eeschema, sim: clean signal list when last panel is closed Fixes: https://gitlab.com/kicad/code/kicad/-/issues/9119 --- eeschema/sim/sim_plot_frame.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index 71b9b3a5f5..254ae1ffbd 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -1350,18 +1350,22 @@ void SIM_PLOT_FRAME::menuTuneUpdate( wxUpdateUIEvent& event ) void SIM_PLOT_FRAME::onPlotClose( wxAuiNotebookEvent& event ) { - int idx = event.GetSelection(); - - if( idx == wxNOT_FOUND ) - return; - - wxCommandEvent dummy; - onCursorUpdate( dummy ); } void SIM_PLOT_FRAME::onPlotClosed( wxAuiNotebookEvent& event ) { + if( m_workbook->GetPageCount() == 0 ) + { + m_signals->ClearAll(); + m_cursors->ClearAll(); + } + else + { + updateSignalList(); + wxCommandEvent dummy; + onCursorUpdate( dummy ); + } }