Browse Source

Move ownership of listener cleanup to BOARD itself

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19736
pcb_db
JamesJCode 9 months ago
parent
commit
00e4d72d4b
  1. 3
      pcbnew/board.cpp
  2. 5
      pcbnew/widgets/pcb_net_inspector_panel.cpp

3
pcbnew/board.cpp

@ -181,6 +181,9 @@ BOARD::~BOARD()
// cause call chains that query the containers
for( BOARD_ITEM* item : ownedItems )
delete item;
// Remove any listeners
RemoveAllListeners();
}

5
pcbnew/widgets/pcb_net_inspector_panel.cpp

@ -86,9 +86,6 @@ PCB_NET_INSPECTOR_PANEL::~PCB_NET_INSPECTOR_PANEL()
m_netsList->AssociateModel( nullptr );
if( m_brd != nullptr )
m_brd->RemoveListener( this );
// Disconnect from board events
m_frame->Unbind( EDA_EVT_UNITS_CHANGED, &PCB_NET_INSPECTOR_PANEL::onUnitsChanged, this );
@ -865,7 +862,7 @@ void PCB_NET_INSPECTOR_PANEL::OnBoardChanged()
{
m_brd = m_frame->GetBoard();
if( m_brd != nullptr )
if( m_brd )
m_brd->AddListener( this );
m_board_loaded = true;

Loading…
Cancel
Save