Create compressed debug report file outside of temporary directory.
Otherwise the compressed file is deleted when the temporary directory is (it doesn't happen if temporarily files are left because an error occurred while the report generation but perversely enough no useful information was left if no errors happened). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61646 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -604,8 +604,14 @@ bool wxDebugReportCompress::DoProcess()
|
|||||||
if ( !count )
|
if ( !count )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// create the compressed report file outside of the directory with the
|
||||||
|
// report files as it will be deleted by wxDebugReport dtor but we want to
|
||||||
|
// keep this one: for this we simply treat the directory name as the name
|
||||||
|
// of the file so that its last component becomes our base name
|
||||||
|
wxFileName fn(GetDirectory());
|
||||||
|
fn.SetExt("zip");
|
||||||
|
|
||||||
// create the streams
|
// create the streams
|
||||||
wxFileName fn(GetDirectory(), GetReportName(), wxT("zip"));
|
|
||||||
wxFFileOutputStream os(fn.GetFullPath(), wxT("wb"));
|
wxFFileOutputStream os(fn.GetFullPath(), wxT("wb"));
|
||||||
wxZipOutputStream zos(os, 9);
|
wxZipOutputStream zos(os, 9);
|
||||||
|
|
||||||
@@ -621,7 +627,7 @@ bool wxDebugReportCompress::DoProcess()
|
|||||||
if ( !zos.PutNextEntry(ze) )
|
if ( !zos.PutNextEntry(ze) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
wxFileName filename(fn.GetPath(), name);
|
const wxFileName filename(GetDirectory(), name);
|
||||||
wxFFileInputStream is(filename.GetFullPath());
|
wxFFileInputStream is(filename.GetFullPath());
|
||||||
if ( !is.IsOk() || !zos.Write(is).IsOk() )
|
if ( !is.IsOk() || !zos.Write(is).IsOk() )
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user