Eeschema: fix a crash at startup in OpenGL engine, when Eeschema is started from Kicad.

Can be platform dependent. The crash was due to a wxPaintEvent fired before the GAL engine is fully initialized.
This commit is contained in:
jean-pierre charras 2018-09-15 16:01:35 +02:00 committed by Jeff Young
parent b42f94e27b
commit 0058ef5825
1 changed files with 8 additions and 3 deletions

View File

@ -674,6 +674,11 @@ void SCH_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
void SCH_DRAW_PANEL::onPaint( wxPaintEvent& aEvent )
{
if( !m_gal->IsInitialized() )
// The first wxPaintEvent can be fired at startup before the GAL engine is fully initialized
// (depending on platforms). Do nothing in this case
return;
if( m_painter )
static_cast<KIGFX::SCH_PAINTER*>(m_painter.get())->GetSettings()->ImportLegacyColors( nullptr );