From 80fb3bde56a908db734dc42ab0d70e67e372a19e Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Wed, 25 Dec 2019 15:53:22 -0500 Subject: [PATCH] Don't try to write fp-info-cache to a read-only directory Fixes #1890 --- pcbnew/pcb_base_edit_frame.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pcbnew/pcb_base_edit_frame.cpp b/pcbnew/pcb_base_edit_frame.cpp index 5f111b179a..3f950f4173 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/pcbnew/pcb_base_edit_frame.cpp @@ -49,8 +49,11 @@ PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME() { - wxTextFile footprintInfoCache( Prj().GetProjectPath() + "fp-info-cache" ); - GFootprintList.WriteCacheToFile( &footprintInfoCache ); + if( wxFileName::IsDirWritable( Prj().GetProjectPath() ) ) + { + wxTextFile footprintInfoCache( Prj().GetProjectPath() + "fp-info-cache" ); + GFootprintList.WriteCacheToFile( &footprintInfoCache ); + } GetCanvas()->GetView()->Clear(); }