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
This commit is contained in:
Maciej Suminski 2016-12-01 15:08:50 +01:00
parent 50a4b5553a
commit 5a3c944b2a
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}