mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-18 21:29:17 +00:00
Move ownership of listener cleanup to BOARD itself
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19736
This commit is contained in:
parent
25379b3094
commit
00e4d72d4b
pcbnew
@ -181,6 +181,9 @@ BOARD::~BOARD()
|
||||
// cause call chains that query the containers
|
||||
for( BOARD_ITEM* item : ownedItems )
|
||||
delete item;
|
||||
|
||||
// Remove any listeners
|
||||
RemoveAllListeners();
|
||||
}
|
||||
|
||||
|
||||
|
@ -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…
Reference in New Issue
Block a user