KiWay: Make sure to mark closed windows as closed

Also make sure to veto project import if we couldn't close the existing project.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13215

Maybe also fixes some other weird crashes, we'll see.
This commit is contained in:
Jon Evans 2022-12-27 10:07:52 -05:00
parent b82833200a
commit 7e778c9856
2 changed files with 5 additions and 1 deletions

View File

@ -466,7 +466,10 @@ bool KIWAY::PlayerClose( FRAME_T aFrameType, bool doForce )
return true;
if( frame->NonUserClose( doForce ) )
{
m_playerFrameId[aFrameType] = wxID_NONE;
return true;
}
return false;
}

View File

@ -60,7 +60,8 @@ void KICAD_MANAGER_FRAME::ImportNonKiCadProject( const wxString& aWindowTitle,
// OK, we got a new project to open. Time to close any existing project before we go on
// to collect info about where to put the new one, etc. Otherwise the workflow is kind of
// disjoint.
CloseProject( true );
if( !CloseProject( true ) )
return;
IMPORT_PROJ_HELPER importProj( this, schdlg.GetPath(), aSchFileExtension, aPcbFileExtension );