From 5a3c944b2a4642a3e1b2dad4970e92bcf2965a2d Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 1 Dec 2016 15:08:50 +0100 Subject: [PATCH] Fix crashes when BOARD members are changed and PNS is active PNS has its own data model with pointers to the BOARD members. If the tool is active and pointers become stale, pcbnew crashes. Currently there is a workaround that deactivates the current tool when a dialog opens. This is the way it is done in the legacy canvas as well. Fixes: lp:1553804 * https://bugs.launchpad.net/kicad/+bug/1553804 --- pcbnew/edit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 2b0197c406..c764c17f44 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -188,6 +188,10 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) SetToolID( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor(), wxEmptyString ); } + + if( TOOL_MANAGER* toolMgr = GetToolManager() ) + toolMgr->DeactivateTool(); + break; }