summaryrefslogtreecommitdiff
path: root/package/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-03 16:19:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-04 08:35:13 +0200
commit2ddddc46fdc3cf18cefcca29934eaab0544d2198 (patch)
treee79a7be6c614ed564ab7ebd13f948d28f738f015 /package/source
parentb0b4649690983143d88a4fae3c49f46ba2db3c51 (diff)
Make ThreadPool::pushTask take param by std::unique_ptr
And fix leak in XclExpRowBuffer::Finalize, was not freeing the synchronous task it creates Change-Id: Id1e9ddb5d968e6b95d9d2b5ca0c9e50774580182 Reviewed-on: https://gerrit.libreoffice.org/56874 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package/source')
-rw-r--r--package/source/zipapi/ZipOutputStream.cxx4
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx3
2 files changed, 4 insertions, 3 deletions
diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx
index f7f54d6ff421..94f8d024dd7c 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -68,9 +68,9 @@ void ZipOutputStream::setEntry( ZipEntry *pEntry )
}
}
-void ZipOutputStream::addDeflatingThread( ZipOutputEntry *pEntry, comphelper::ThreadTask *pThread )
+void ZipOutputStream::addDeflatingThread( ZipOutputEntry *pEntry, std::unique_ptr<comphelper::ThreadTask> pThread )
{
- comphelper::ThreadPool::getSharedOptimalPool().pushTask(pThread);
+ comphelper::ThreadPool::getSharedOptimalPool().pushTask(std::move(pThread));
m_aEntries.push_back(pEntry);
}
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 908a093cb62d..a558be575127 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -50,6 +50,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
+#include <o3tl/make_unique.hxx>
#include <rtl/instance.hxx>
#include <rtl/random.h>
@@ -835,7 +836,7 @@ bool ZipPackageStream::saveChild(
// Start a new thread deflating this zip entry
ZipOutputEntry *pZipEntry = new ZipOutputEntry(
m_xContext, *pTempEntry, this, bToBeEncrypted);
- rZipOut.addDeflatingThread( pZipEntry, new DeflateThread(rZipOut.getThreadTaskTag(), pZipEntry, xStream) );
+ rZipOut.addDeflatingThread( pZipEntry, o3tl::make_unique<DeflateThread>(rZipOut.getThreadTaskTag(), pZipEntry, xStream) );
}
else
{