Clear view before resetting schematic.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15159
This commit is contained in:
Alex Shvartzkop 2023-07-11 03:00:16 +05:00
parent 415dcf82c4
commit cab0db76f8
1 changed files with 3 additions and 0 deletions

View File

@ -671,6 +671,9 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
Schematic().SetProject( nullptr );
GetSettingsManager()->UnloadProject( &Prj(), false );
// Clear view before destroying schematic as repaints depend on schematic being valid
SetScreen( nullptr );
Schematic().Reset();
wxFileName projectFn( dlg.GetPath() );