Browse Source

Simulator: fix crash when deselecting the Probe Tool in some cases.

If a schematic item was selected, when activating the probe tool from the
simulator, and deactivating from the Select Item sch editor tool, a crash
happened.
From master branch

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18547
8.0
jean-pierre charras 11 months ago
parent
commit
c8f7887cf8
  1. 9
      eeschema/tools/sch_editor_control.cpp

9
eeschema/tools/sch_editor_control.cpp

@ -555,6 +555,11 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent )
[this, simFrame]( const VECTOR2D& aPosition )
{
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
// We do not really want to keep an item selected in schematic,
// so clear the current selection
selTool->ClearSelection();
EDA_ITEM* item = selTool->GetNode( aPosition );
SCH_SHEET_PATH& sheet = m_frame->GetCurrentSheet();
@ -684,6 +689,10 @@ int SCH_EDITOR_CONTROL::SimProbe( const TOOL_EVENT& aEvent )
}
// 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 SimProbe tool is deselected )
EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
selectionTool->ClearSelection();
m_toolMgr->PostAction( EE_ACTIONS::selectionActivate );
} );

Loading…
Cancel
Save