Eeschema: fix potential crash when closing Kicad app.
The crash happens when a wxPaint event is fired after deleting the schematic frame. It happened only on one Linux install. Fixes: lp:1800874 * https://bugs.launchpad.net/kicad/+bug/1800874
This commit is contained in:
parent
08814b0512
commit
bf42247971
|
@ -682,8 +682,14 @@ void SCH_DRAW_PANEL::onPaint( wxPaintEvent& aEvent )
|
||||||
// (depending on platforms). Do nothing in this case
|
// (depending on platforms). Do nothing in this case
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
SCH_SCREEN* screen = static_cast<SCH_SCREEN*>( GetScreen() );
|
||||||
|
|
||||||
|
// The screen might be null if the wxPaintEvent is fired after the parent frame deletion
|
||||||
|
if( !screen )
|
||||||
|
return;
|
||||||
|
|
||||||
// Ensure links are up to date, even if a library was reloaded for some reason:
|
// Ensure links are up to date, even if a library was reloaded for some reason:
|
||||||
static_cast<SCH_SCREEN*>( GetScreen() )->UpdateSymbolLinks();
|
screen->UpdateSymbolLinks();
|
||||||
|
|
||||||
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