Fixed crash on double switching to legacy canvas on start.

This commit is contained in:
Maciej Suminski 2015-07-02 11:40:36 +02:00
parent 9d27caca75
commit 1073ba1999
1 changed files with 4 additions and 1 deletions

View File

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