From a5622c93d49f8baf4a31bf5ff3ef6e8c3af202c7 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 (cherry picked from commit 80fb3bde56a908db734dc42ab0d70e67e372a19e) --- 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 d69b6b465e..c205c61c9f 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/pcbnew/pcb_base_edit_frame.cpp @@ -48,8 +48,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 ); + } }