Fix crash when switching schematics
When switching schematics that causes an error message (for example if the schematic needs repair), wx can refresh in between view updates, leading to a null preview.
This commit is contained in:
parent
015c4d5779
commit
df573255e0
|
@ -1529,13 +1529,16 @@ std::shared_ptr<VIEW_OVERLAY> VIEW::MakeOverlay()
|
|||
|
||||
void VIEW::ClearPreview()
|
||||
{
|
||||
m_preview->Clear();
|
||||
if( !m_preview )
|
||||
return;
|
||||
|
||||
for( EDA_ITEM* item : m_ownedItems )
|
||||
delete item;
|
||||
m_preview->Clear();
|
||||
|
||||
m_ownedItems.clear();
|
||||
Update( m_preview.get() );
|
||||
for( EDA_ITEM *item : m_ownedItems )
|
||||
delete item;
|
||||
|
||||
m_ownedItems.clear();
|
||||
Update( m_preview.get() );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue