mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Let wx auto-close streams in compressed IPC-2581 export.
Removing the temp file was not possible if it's still open.
This commit is contained in:
parent
8f7b692720
commit
0594a43cfa
@ -1387,15 +1387,14 @@ void PCB_EDIT_FRAME::GenIPC2581File( wxCommandEvent& event )
|
||||
wxFileName zipfn = tempFile;
|
||||
zipfn.SetExt( "zip" );
|
||||
|
||||
wxFFileOutputStream fnout( zipfn.GetFullPath() );
|
||||
wxZipOutputStream zip( fnout );
|
||||
wxFFileInputStream fnin( tempFile );
|
||||
{
|
||||
wxFFileOutputStream fnout( zipfn.GetFullPath() );
|
||||
wxZipOutputStream zip( fnout );
|
||||
wxFFileInputStream fnin( tempFile );
|
||||
|
||||
zip.PutNextEntry( tempfn.GetFullName() );
|
||||
fnin.Read( zip );
|
||||
zip.Close();
|
||||
fnout.Close();
|
||||
fnin.GetFile()->Close();
|
||||
zip.PutNextEntry( tempfn.GetFullName() );
|
||||
fnin.Read( zip );
|
||||
}
|
||||
|
||||
wxRemoveFile( tempFile );
|
||||
tempFile = zipfn.GetFullPath();
|
||||
|
@ -2025,14 +2025,14 @@ int PCBNEW_JOBS_HANDLER::JobExportIpc2581( JOB* aJob )
|
||||
wxFileName zipfn = tempFile;
|
||||
zipfn.SetExt( "zip" );
|
||||
|
||||
wxFFileOutputStream fnout( zipfn.GetFullPath() );
|
||||
wxZipOutputStream zip( fnout );
|
||||
wxFFileInputStream fnin( tempFile );
|
||||
{
|
||||
wxFFileOutputStream fnout( zipfn.GetFullPath() );
|
||||
wxZipOutputStream zip( fnout );
|
||||
wxFFileInputStream fnin( tempFile );
|
||||
|
||||
zip.PutNextEntry( tempfn.GetFullName() );
|
||||
fnin.Read( zip );
|
||||
zip.Close();
|
||||
fnout.Close();
|
||||
zip.PutNextEntry( tempfn.GetFullName() );
|
||||
fnin.Read( zip );
|
||||
}
|
||||
|
||||
wxRemoveFile( tempFile );
|
||||
tempFile = zipfn.GetFullPath();
|
||||
|
Loading…
x
Reference in New Issue
Block a user