Browse Source

Fix assertion failure quitting gerbview

Fixes: lp:1744600
https://bugs.launchpad.net/kicad/+bug/1744600
pull/5/merge
jean-pierre charras 8 years ago
parent
commit
61193dcd13
  1. 20
      gerbview/gerbview_frame.cpp

20
gerbview/gerbview_frame.cpp

@ -280,14 +280,6 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
GERBVIEW_FRAME::~GERBVIEW_FRAME()
{
if( m_toolManager )
m_toolManager->DeactivateTool();
if( auto canvas = GetGalCanvas() )
{
canvas->GetView()->Clear();
}
GetGerberLayout()->GetImagesList()->DeleteAllImages();
delete m_gerberLayout;
}
@ -295,6 +287,18 @@ GERBVIEW_FRAME::~GERBVIEW_FRAME()
void GERBVIEW_FRAME::OnCloseWindow( wxCloseEvent& Event )
{
if( m_toolManager )
m_toolManager->DeactivateTool();
if( IsGalCanvasActive() )
{
GetGalCanvas()->GetView()->Clear();
// Be sure any OpenGL event cannot be fired after frame deletion:
GetGalCanvas()->SetEvtHandlerEnabled( false );
}
GetGalCanvas()->StopDrawing();
Destroy();
}

Loading…
Cancel
Save