Browse Source

~EDA_DRAW_PANEL_GAL(): Fix crash: ensure a onShowEvent is not fired.

Due to changes in EDA_DRAW_PANEL_GAL (a wxEVT_SHOW event was added) when
destroyed a dialog using it (namely the PAD editor) a wxEVT_SHOW event was fired
during Dtor process (at least on Windows). It is now disabled in Dtor.
revert-0c36e162
jean-pierre charras 10 months ago
parent
commit
21725eeef3
  1. 3
      common/draw_panel_gal.cpp

3
common/draw_panel_gal.cpp

@ -166,6 +166,8 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
EDA_DRAW_PANEL_GAL::~EDA_DRAW_PANEL_GAL()
{
// Ensure EDA_DRAW_PANEL_GAL::onShowEvent is not fired during Dtor process
Disconnect( wxEVT_SHOW, wxShowEventHandler( EDA_DRAW_PANEL_GAL::onShowEvent ) );
StopDrawing();
wxASSERT( !m_drawing );
@ -173,6 +175,7 @@ EDA_DRAW_PANEL_GAL::~EDA_DRAW_PANEL_GAL()
delete m_viewControls;
delete m_view;
delete m_gal;
m_gal = nullptr; // Ensure OnShow is not called
}

Loading…
Cancel
Save