Loading pcbnew/legacy_plugin.cpp +20 −13 Original line number Diff line number Diff line Loading @@ -3933,8 +3933,10 @@ void FPL_CACHE::Save() wxString tempFileName = wxFileName::CreateTempFileName( m_lib_name ); wxLogDebug( "tempFileName:'%s'\n", TO_UTF8( tempFileName ) ); // wxLogDebug( "tempFileName:'%s'\n", TO_UTF8( tempFileName ) ); // a block {} scope to fire wxFFile wxf()'s destructor { FILE* fp = wxFopen( tempFileName, wxT( "w" ) ); if( !fp ) { Loading @@ -3943,13 +3945,18 @@ void FPL_CACHE::Save() m_lib_name.GetData() ) ); } // wxf now owns fp, will close on exception or return // wxf now owns fp, will close on exception or exit from // this block {} scope wxFFile wxf( fp ); SaveHeader( fp ); SaveIndex( fp ); SaveModules( fp ); SaveEndOfFile( fp ); } // fp is now closed here, and that seems proper before trying to rename // the temporary file to m_lib_name. wxRemove( m_lib_name ); // it is not an error if this does not exist Loading Loading
pcbnew/legacy_plugin.cpp +20 −13 Original line number Diff line number Diff line Loading @@ -3933,8 +3933,10 @@ void FPL_CACHE::Save() wxString tempFileName = wxFileName::CreateTempFileName( m_lib_name ); wxLogDebug( "tempFileName:'%s'\n", TO_UTF8( tempFileName ) ); // wxLogDebug( "tempFileName:'%s'\n", TO_UTF8( tempFileName ) ); // a block {} scope to fire wxFFile wxf()'s destructor { FILE* fp = wxFopen( tempFileName, wxT( "w" ) ); if( !fp ) { Loading @@ -3943,13 +3945,18 @@ void FPL_CACHE::Save() m_lib_name.GetData() ) ); } // wxf now owns fp, will close on exception or return // wxf now owns fp, will close on exception or exit from // this block {} scope wxFFile wxf( fp ); SaveHeader( fp ); SaveIndex( fp ); SaveModules( fp ); SaveEndOfFile( fp ); } // fp is now closed here, and that seems proper before trying to rename // the temporary file to m_lib_name. wxRemove( m_lib_name ); // it is not an error if this does not exist Loading