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:
parent
b42f94e27b
commit
0058ef5825
|
@ -674,6 +674,11 @@ void SCH_DRAW_PANEL::OnKeyEvent( wxKeyEvent& event )
|
||||||
|
|
||||||
void SCH_DRAW_PANEL::onPaint( wxPaintEvent& aEvent )
|
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 )
|
if( m_painter )
|
||||||
static_cast<KIGFX::SCH_PAINTER*>(m_painter.get())->GetSettings()->ImportLegacyColors( nullptr );
|
static_cast<KIGFX::SCH_PAINTER*>(m_painter.get())->GetSettings()->ImportLegacyColors( nullptr );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue