From 1073ba1999c2a4254c9c7cb198d5ce3733f3f9f6 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 2 Jul 2015 11:40:36 +0200 Subject: [PATCH] Fixed crash on double switching to legacy canvas on start. --- pcbnew/pcbframe.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 158830c764..ca6c186fa2 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -532,7 +532,7 @@ void PCB_EDIT_FRAME::setupTools() { // Create the manager and dispatcher & route draw panel events to the dispatcher m_toolManager = new TOOL_MANAGER; - m_toolManager->SetEnvironment( NULL, GetGalCanvas()->GetView(), + m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(), GetGalCanvas()->GetViewControls(), this ); m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager ); @@ -661,6 +661,9 @@ void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable ) { EDA_DRAW_FRAME::UseGalCanvas( aEnable ); + m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(), + GetGalCanvas()->GetViewControls(), this ); + if( aEnable ) { SetBoard( m_Pcb );