diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index fadf3e1774..3ff1a97f51 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -125,7 +125,7 @@ PCB_BASE_FRAME::~PCB_BASE_FRAME() { delete m_Collector; - delete m_Pcb; // is already NULL for FOOTPRINT_EDIT_FRAME + delete m_Pcb; delete GetGalCanvas(); } diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index ed9ff6165e..2fa40ac774 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -268,21 +268,23 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : m_toolManager->SetEnvironment( GetBoard(), drawPanel->GetView(), drawPanel->GetViewControls(), this ); m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager ); - drawPanel->SetEventDispatcher( m_toolDispatcher ); - m_toolManager->RegisterTool( new SELECTION_TOOL ); - m_toolManager->RegisterTool( new EDIT_TOOL ); - m_toolManager->RegisterTool( new DRAWING_TOOL ); - m_toolManager->RegisterTool( new POINT_EDITOR ); - m_toolManager->RegisterTool( new PCBNEW_CONTROL ); - m_toolManager->GetTool()->EditModules( true ); - m_toolManager->GetTool()->EditModules( true ); - m_toolManager->ResetTools( TOOL_BASE::RUN ); + if( drawFrame->IsGalCanvasActive() ) + { + drawPanel->SetEventDispatcher( m_toolDispatcher ); - // Run the selection tool, it is supposed to be always active - m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" ); + m_toolManager->RegisterTool( new SELECTION_TOOL ); + m_toolManager->RegisterTool( new EDIT_TOOL ); + m_toolManager->RegisterTool( new DRAWING_TOOL ); + m_toolManager->RegisterTool( new POINT_EDITOR ); + m_toolManager->RegisterTool( new PCBNEW_CONTROL ); + m_toolManager->GetTool()->EditModules( true ); + m_toolManager->GetTool()->EditModules( true ); + m_toolManager->ResetTools( TOOL_BASE::RUN ); + m_toolManager->InvokeTool( "pcbnew.InteractiveSelection" ); - UseGalCanvas( drawFrame->IsGalCanvasActive() ); + UseGalCanvas( true ); + } m_Layers->ReFill(); m_Layers->ReFillRender();