Disconnect event handlers in symbol properties dialog dtor.
This is probably a good rule of thumb to prevent any event ordering issues between platforms or unhandled events being trigger during inherited object destruction.
This commit is contained in:
parent
e03a91c9c7
commit
b95ce69054
|
@ -380,19 +380,11 @@ DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES( SCH_EDIT_FRAME* aParent,
|
||||||
m_bpMoveDown->SetBitmap( KiBitmap( BITMAPS::small_down ) );
|
m_bpMoveDown->SetBitmap( KiBitmap( BITMAPS::small_down ) );
|
||||||
|
|
||||||
// wxFormBuilder doesn't include this event...
|
// wxFormBuilder doesn't include this event...
|
||||||
m_fieldsGrid->Connect( wxEVT_GRID_CELL_CHANGING,
|
m_fieldsGrid->Bind( wxEVT_GRID_CELL_CHANGING, &DIALOG_SYMBOL_PROPERTIES::OnGridCellChanging,
|
||||||
wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES::OnGridCellChanging ),
|
this );
|
||||||
nullptr, this );
|
m_pinGrid->Bind( wxEVT_GRID_COL_SORT, &DIALOG_SYMBOL_PROPERTIES::OnPinTableColSort, this );
|
||||||
|
Bind( SYMBOL_DELAY_FOCUS, &DIALOG_SYMBOL_PROPERTIES::HandleDelayedFocus, this );
|
||||||
m_pinGrid->Connect( wxEVT_GRID_COL_SORT,
|
Bind( SYMBOL_DELAY_SELECTION, &DIALOG_SYMBOL_PROPERTIES::HandleDelayedSelection, this );
|
||||||
wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES::OnPinTableColSort ),
|
|
||||||
nullptr, this );
|
|
||||||
|
|
||||||
Connect( SYMBOL_DELAY_FOCUS,
|
|
||||||
wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES::HandleDelayedFocus ), nullptr, this );
|
|
||||||
Connect( SYMBOL_DELAY_SELECTION,
|
|
||||||
wxCommandEventHandler( DIALOG_SYMBOL_PROPERTIES::HandleDelayedSelection ), nullptr,
|
|
||||||
this );
|
|
||||||
|
|
||||||
QueueEvent( new wxCommandEvent( SYMBOL_DELAY_SELECTION ) );
|
QueueEvent( new wxCommandEvent( SYMBOL_DELAY_SELECTION ) );
|
||||||
wxCommandEvent *evt = new wxCommandEvent( SYMBOL_DELAY_FOCUS );
|
wxCommandEvent *evt = new wxCommandEvent( SYMBOL_DELAY_FOCUS );
|
||||||
|
@ -416,13 +408,11 @@ DIALOG_SYMBOL_PROPERTIES::~DIALOG_SYMBOL_PROPERTIES()
|
||||||
if( m_dataModel )
|
if( m_dataModel )
|
||||||
m_pinGrid->DestroyTable( m_dataModel );
|
m_pinGrid->DestroyTable( m_dataModel );
|
||||||
|
|
||||||
m_fieldsGrid->Disconnect( wxEVT_GRID_CELL_CHANGING,
|
m_fieldsGrid->Unbind( wxEVT_GRID_CELL_CHANGING, &DIALOG_SYMBOL_PROPERTIES::OnGridCellChanging,
|
||||||
wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES::OnGridCellChanging ),
|
this );
|
||||||
nullptr, this );
|
m_pinGrid->Unbind( wxEVT_GRID_COL_SORT, &DIALOG_SYMBOL_PROPERTIES::OnPinTableColSort, this );
|
||||||
|
Unbind( SYMBOL_DELAY_FOCUS, &DIALOG_SYMBOL_PROPERTIES::HandleDelayedFocus, this );
|
||||||
m_pinGrid->Disconnect( wxEVT_GRID_COL_SORT,
|
Unbind( SYMBOL_DELAY_SELECTION, &DIALOG_SYMBOL_PROPERTIES::HandleDelayedSelection, this );
|
||||||
wxGridEventHandler( DIALOG_SYMBOL_PROPERTIES::OnPinTableColSort ),
|
|
||||||
nullptr, this );
|
|
||||||
|
|
||||||
// Delete the GRID_TRICKS.
|
// Delete the GRID_TRICKS.
|
||||||
m_fieldsGrid->PopEventHandler( true );
|
m_fieldsGrid->PopEventHandler( true );
|
||||||
|
|
Loading…
Reference in New Issue