From 65e41592a650887c8d00586385119effa54de5fa Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 9 Jul 2018 17:10:49 +0200 Subject: 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 --- sax/qa/cppunit/xmlimport.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sax/qa') diff --git a/sax/qa/cppunit/xmlimport.cxx b/sax/qa/cppunit/xmlimport.cxx index f7ea3ec92c19..b22f9d268e8a 100644 --- a/sax/qa/cppunit/xmlimport.cxx +++ b/sax/qa/cppunit/xmlimport.cxx @@ -65,10 +65,10 @@ Reference< XInputStream > createStreamFromFile ( Reference< XInputStream > xInputStream; OUString aInStr; FileBase::getFileURLFromSystemPath(filePath, aInStr); - SvStream* pStream = utl::UcbStreamHelper::CreateStream(aInStr, StreamMode::READ); + std::unique_ptr pStream = utl::UcbStreamHelper::CreateStream(aInStr, StreamMode::READ); if(pStream == nullptr) CPPUNIT_ASSERT(false); - Reference< XStream > xStream(new utl::OStreamWrapper(*pStream)); + Reference< XStream > xStream(new utl::OStreamWrapper(std::move(pStream))); xInputStream.set(xStream, UNO_QUERY); return xInputStream; } -- cgit