Don't try to write fp-info-cache to a read-only directory

Fixes #1890
This commit is contained in:
Jon Evans 2019-12-25 15:53:22 -05:00
parent e6e2cf47fd
commit 80fb3bde56
1 changed files with 5 additions and 2 deletions

View File

@ -49,8 +49,11 @@ PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME() PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME()
{ {
wxTextFile footprintInfoCache( Prj().GetProjectPath() + "fp-info-cache" ); if( wxFileName::IsDirWritable( Prj().GetProjectPath() ) )
GFootprintList.WriteCacheToFile( &footprintInfoCache ); {
wxTextFile footprintInfoCache( Prj().GetProjectPath() + "fp-info-cache" );
GFootprintList.WriteCacheToFile( &footprintInfoCache );
}
GetCanvas()->GetView()->Clear(); GetCanvas()->GetView()->Clear();
} }