summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-09 17:10:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-10 08:30:21 +0200
commit65e41592a650887c8d00586385119effa54de5fa (patch)
tree4b0f6c7f52159d9cf70c561c815f623d3b57198d /filter
parentacb7c06ab171d4201842d8183eefeeca2d28c3f5 (diff)
pass SvStream around by std::unique_ptr
and give utl::OStreamWrapper a new constructor so that it knows it is taking ownership of the SvStream, which appears to fix several leaks Change-Id: Idcbcca9b81a4f0345fd8b8c8a2f4e84213686a6b Reviewed-on: https://gerrit.libreoffice.org/57187 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/svg/svgexport.cxx2
-rw-r--r--filter/source/textfilterdetect/filterdetect.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index d4db26ef8e52..91a1d35c3bb4 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -517,7 +517,7 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
OUString aFileName;
pValue[ i ].Value >>= aFileName;
- pOStm.reset(::utl::UcbStreamHelper::CreateStream( aFileName, StreamMode::WRITE | StreamMode::TRUNC ));
+ pOStm = ::utl::UcbStreamHelper::CreateStream( aFileName, StreamMode::WRITE | StreamMode::TRUNC );
if( pOStm )
xOStm.set( new ::utl::OOutputStreamWrapper ( *pOStm ) );
diff --git a/filter/source/textfilterdetect/filterdetect.cxx b/filter/source/textfilterdetect/filterdetect.cxx
index 2e3e08028683..3eeb0b1ee485 100644
--- a/filter/source/textfilterdetect/filterdetect.cxx
+++ b/filter/source/textfilterdetect/filterdetect.cxx
@@ -165,9 +165,9 @@ OUString SAL_CALL PlainTextFilterDetect::detect(uno::Sequence<beans::PropertyVal
ZCodec aCodecGZ;
std::unique_ptr<SvStream> pInStream;
if (xStream.is())
- pInStream.reset(utl::UcbStreamHelper::CreateStream(xStream));
+ pInStream = utl::UcbStreamHelper::CreateStream(xStream);
else
- pInStream.reset(utl::UcbStreamHelper::CreateStream(xInStream));
+ pInStream = utl::UcbStreamHelper::CreateStream(xInStream);
std::unique_ptr<SvMemoryStream> pDecompressedStream(new SvMemoryStream());
if (aCodecGZ.AttemptDecompression(*pInStream, *pDecompressedStream))
{