diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-09 17:10:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-10 08:30:21 +0200 |
commit | 65e41592a650887c8d00586385119effa54de5fa (patch) | |
tree | 4b0f6c7f52159d9cf70c561c815f623d3b57198d /sw/qa/extras/inc | |
parent | acb7c06ab171d4201842d8183eefeeca2d28c3f5 (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 'sw/qa/extras/inc')
-rw-r--r-- | sw/qa/extras/inc/swmodeltestbase.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index ea3ce849a623..e0d304beabc8 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -194,11 +194,11 @@ protected: xImporter->setTargetDocument(mxComponent); uno::Sequence<beans::PropertyValue> aDescriptor(3); aDescriptor[0].Name = "InputStream"; - SvStream* pStream = utl::UcbStreamHelper::CreateStream( + std::unique_ptr<SvStream> pStream = utl::UcbStreamHelper::CreateStream( m_directories.getURLFromSrc("/sw/qa/extras/") + aFilename, StreamMode::STD_READ); CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, pStream->GetError()); - uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStream)); + uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(std::move(pStream))); aDescriptor[0].Value <<= xStream; aDescriptor[1].Name = "InsertMode"; aDescriptor[1].Value <<= true; |