From e9577a1025afddc2908668dc41fe999e829c90ca Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 29 May 2017 18:22:36 +0200 Subject: [PATCH] Fixes: lp:1692706 (eeschema cache lib not rebuilt when saving schematic, and existing symbols already in cache are not updated) https://bugs.launchpad.net/kicad/+bug/1692706 --- eeschema/libarch.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/eeschema/libarch.cpp b/eeschema/libarch.cpp index 21317a93bc..e81ab6a589 100644 --- a/eeschema/libarch.cpp +++ b/eeschema/libarch.cpp @@ -61,13 +61,9 @@ bool SCH_EDIT_FRAME::CreateArchiveLibrary( const wxString& aFileName ) wxString msg; SCH_SCREENS screens; PART_LIBS* libs = Prj().SchLibs(); - PART_LIB* cacheLib = libs->FindLibraryByFullFileName( aFileName ); - if( !cacheLib ) - { - cacheLib = new PART_LIB( LIBRARY_TYPE_EESCHEMA, aFileName ); - libs->push_back( cacheLib ); - } + // Create a new empty library to archive components: + PART_LIB* cacheLib = new PART_LIB( LIBRARY_TYPE_EESCHEMA, aFileName ); cacheLib->SetCache(); cacheLib->EnableBuffering(); @@ -113,7 +109,7 @@ bool SCH_EDIT_FRAME::CreateArchiveLibrary( const wxString& aFileName ) try { cacheLib->Save( false ); - cacheLib->EnableBuffering( false ); + delete cacheLib; } catch( ... /* IO_ERROR ioe */ ) {