[Libreoffice-commits] core.git: package/inc package/source
Caolán McNamara
caolanm at redhat.com
Fri Aug 7 00:53:39 PDT 2015
package/inc/ZipOutputEntry.hxx | 1 +
package/source/zipapi/ZipOutputEntry.cxx | 7 +++++++
package/source/zipapi/ZipOutputStream.cxx | 2 ++
3 files changed, 10 insertions(+)
New commits:
commit ef698035aa2aa64fc4c4455b394e6782772fef4f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Aug 5 23:26:27 2015 +0100
Related: tdf#88314 delete temp files
clear to close the inputstream before attempting to delete the temp file, which
is plausible as the windows-specific failure in earlier attempts at this
Change-Id: I751aa3a098dd960f56b77a5f5fc93783c1060556
Reviewed-on: https://gerrit.libreoffice.org/17531
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/package/inc/ZipOutputEntry.hxx b/package/inc/ZipOutputEntry.hxx
index d431a07..3a6447c 100644
--- a/package/inc/ZipOutputEntry.hxx
+++ b/package/inc/ZipOutputEntry.hxx
@@ -69,6 +69,7 @@ public:
css::uno::Reference< css::io::XInputStream > getData() const;
::css::uno::Any getParallelDeflateException() const { return m_aParallelDeflateException; }
void closeBufferFile();
+ void deleteBufferFile();
ZipEntry* getZipEntry() { return m_pCurrentEntry; }
ZipPackageStream* getZipPackageStream() { return m_pCurrentStream; }
diff --git a/package/source/zipapi/ZipOutputEntry.cxx b/package/source/zipapi/ZipOutputEntry.cxx
index e307003..47ecbb4 100644
--- a/package/source/zipapi/ZipOutputEntry.cxx
+++ b/package/source/zipapi/ZipOutputEntry.cxx
@@ -114,6 +114,13 @@ void ZipOutputEntry::closeBufferFile()
m_xOutStream.clear();
}
+void ZipOutputEntry::deleteBufferFile()
+{
+ assert(!m_xOutStream.is() && !m_aTempURL.isEmpty());
+ uno::Reference < ucb::XSimpleFileAccess3 > xAccess(ucb::SimpleFileAccess::create(m_xContext));
+ xAccess->kill(m_aTempURL);
+}
+
uno::Reference< io::XInputStream > ZipOutputEntry::getData() const
{
uno::Reference < ucb::XSimpleFileAccess3 > xTempAccess(ucb::SimpleFileAccess::create(m_xContext));
diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx
index 4acfa77..be261cd 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -121,10 +121,12 @@ void ZipOutputStream::finish()
rawWrite(aSequence);
}
while (nRead == n_ConstBufferSize);
+ xInput.clear();
rawCloseEntry(m_aEntries[i]->isEncrypt());
m_aEntries[i]->getZipPackageStream()->successfullyWritten(m_aEntries[i]->getZipEntry());
+ m_aEntries[i]->deleteBufferFile();
delete m_aEntries[i];
}
More information about the Libreoffice-commits
mailing list