Fix assertion failure quitting gerbview
Fixes: lp:1744600 https://bugs.launchpad.net/kicad/+bug/1744600
This commit is contained in:
parent
6b9a286a85
commit
61193dcd13
|
@ -280,14 +280,6 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
||||||
|
|
||||||
GERBVIEW_FRAME::~GERBVIEW_FRAME()
|
GERBVIEW_FRAME::~GERBVIEW_FRAME()
|
||||||
{
|
{
|
||||||
if( m_toolManager )
|
|
||||||
m_toolManager->DeactivateTool();
|
|
||||||
|
|
||||||
if( auto canvas = GetGalCanvas() )
|
|
||||||
{
|
|
||||||
canvas->GetView()->Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
GetGerberLayout()->GetImagesList()->DeleteAllImages();
|
GetGerberLayout()->GetImagesList()->DeleteAllImages();
|
||||||
delete m_gerberLayout;
|
delete m_gerberLayout;
|
||||||
}
|
}
|
||||||
|
@ -295,6 +287,18 @@ GERBVIEW_FRAME::~GERBVIEW_FRAME()
|
||||||
|
|
||||||
void GERBVIEW_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
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();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue