eeschema: fix crash when the simulator frame is open and the Tune tool is actived.
In some cases when the Tune tool is actived and a symbol is selected, if the tool is deactivated from the right toolbar in Eeschema, Eeschema crashes.
This commit is contained in:
parent
f72f637a06
commit
29756278e0
|
@ -890,6 +890,9 @@ int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent )
|
||||||
if( simFrame )
|
if( simFrame )
|
||||||
static_cast<SIM_PLOT_FRAME*>( simFrame )->AddTuner( symbol );
|
static_cast<SIM_PLOT_FRAME*>( simFrame )->AddTuner( symbol );
|
||||||
|
|
||||||
|
// We do not really want to keep a symbol selected in schematic,
|
||||||
|
// so clear the current selection
|
||||||
|
selTool->ClearSelection();
|
||||||
return true;
|
return true;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -924,6 +927,10 @@ int SCH_EDITOR_CONTROL::SimTune( const TOOL_EVENT& aEvent )
|
||||||
m_toolMgr->GetTool<EE_SELECTION_TOOL>()->UnbrightenItem( m_pickerItem );
|
m_toolMgr->GetTool<EE_SELECTION_TOOL>()->UnbrightenItem( m_pickerItem );
|
||||||
|
|
||||||
// Wake the selection tool after exiting to ensure the cursor gets updated
|
// Wake the selection tool after exiting to ensure the cursor gets updated
|
||||||
|
// and deselect previous selection from simulator to avoid any issue
|
||||||
|
// ( avoid crash in some cases when the SimTune tool is deselected )
|
||||||
|
EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
|
||||||
|
selectionTool->ClearSelection();
|
||||||
m_toolMgr->RunAction( EE_ACTIONS::selectionActivate, false );
|
m_toolMgr->RunAction( EE_ACTIONS::selectionActivate, false );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue