Browse Source

Make sure that we are disconnected before dtor

The child class removes itself from the parent panel, which calls the
DTOR.  This automatically disconnects the events, so if we want to
explicitly do this, we need to do it before freeing the memory

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21307
pull/18/head
Seth Hillbrand 5 months ago
parent
commit
8b62eac886
  1. 3
      pcbnew/dialogs/panel_assign_component_classes.cpp

3
pcbnew/dialogs/panel_assign_component_classes.cpp

@ -604,11 +604,10 @@ PANEL_COMPONENT_CLASS_CONDITION_REFERENCE::PANEL_COMPONENT_CLASS_CONDITION_REFER
void PANEL_COMPONENT_CLASS_CONDITION_REFERENCE::OnDeleteConditionClick( wxCommandEvent& event )
{
m_panelParent->RemoveCondition( this );
Disconnect( wxEVT_MENU,
wxCommandEventHandler( PANEL_COMPONENT_CLASS_CONDITION_REFERENCE::onMenu ), nullptr,
this );
m_panelParent->RemoveCondition( this );
}

Loading…
Cancel
Save