summaryrefslogtreecommitdiff
path: root/vcl/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 /vcl/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 'vcl/source')
-rw-r--r--vcl/source/bitmap/BitmapScaleSuperFilter.cxx4
-rw-r--r--vcl/source/filter/graphicfilter.cxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx
index f096bd7429ff..01e922a9fa57 100644
--- a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx
+++ b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx
@@ -1038,14 +1038,14 @@ BitmapEx BitmapScaleSuperFilter::execute(BitmapEx const& rBitmap)
long nStripY = nStartY;
for ( sal_uInt32 t = 0; t < nThreads - 1; t++ )
{
- ScaleTask *pTask = new ScaleTask( pTag, pScaleRangeFn );
+ std::unique_ptr<ScaleTask> pTask(new ScaleTask( pTag, pScaleRangeFn ));
for ( sal_uInt32 j = 0; j < nStripsPerThread; j++ )
{
ScaleRangeContext aRC( &aContext, nStripY );
pTask->push( aRC );
nStripY += SCALE_THREAD_STRIP;
}
- rShared.pushTask( pTask );
+ rShared.pushTask( std::move(pTask) );
}
// finish any remaining bits here
pScaleRangeFn( aContext, nStripY, nEndY );
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index b928b83f7695..fea987a63520 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -1385,7 +1385,7 @@ void GraphicFilter::ImportGraphics(std::vector< std::shared_ptr<Graphic> >& rGra
rContext.m_pAccess = o3tl::make_unique<BitmapScopedWriteAccess>(rBitmap);
pStream->Seek(rContext.m_nStreamBegin);
if (bThreads)
- rSharedPool.pushTask(new GraphicImportTask(pTag, rContext));
+ rSharedPool.pushTask(o3tl::make_unique<GraphicImportTask>(pTag, rContext));
else
GraphicImportTask::doImport(rContext);
}