Browse Source

Add RemoveAllListeners function for future addons

7.0
Marek Roszko 3 years ago
parent
commit
3e451ca516
  1. 6
      pcbnew/board.cpp
  2. 5
      pcbnew/board.h
  3. 2
      pcbnew/pcb_edit_frame.cpp

6
pcbnew/board.cpp

@ -1966,6 +1966,12 @@ void BOARD::RemoveListener( BOARD_LISTENER* aListener )
}
void BOARD::RemoveAllListeners()
{
m_listeners.clear();
}
void BOARD::OnItemChanged( BOARD_ITEM* aItem )
{
InvokeListeners( &BOARD_LISTENER::OnBoardItemChanged, *this, aItem );

5
pcbnew/board.h

@ -1081,6 +1081,11 @@ public:
*/
void RemoveListener( BOARD_LISTENER* aListener );
/**
* Remove all listeners
*/
void RemoveAllListeners();
/**
* Notify the board and its listeners that an item on the board has
* been modified in some way.

2
pcbnew/pcb_edit_frame.cpp

@ -448,7 +448,7 @@ PCB_EDIT_FRAME::~PCB_EDIT_FRAME()
m_toolManager->ShutdownAllTools();
if( GetBoard() )
GetBoard()->RemoveListener( m_appearancePanel );
GetBoard()->RemoveAllListeners();
delete m_selectionFilterPanel;
delete m_appearancePanel;

Loading…
Cancel
Save