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 /writerperfect | |
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 'writerperfect')
-rw-r--r-- | writerperfect/source/common/WPXSvInputStream.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx index 2dfee8a44799..1c06f1b784bd 100644 --- a/writerperfect/source/common/WPXSvInputStream.cxx +++ b/writerperfect/source/common/WPXSvInputStream.cxx @@ -144,7 +144,7 @@ struct OLEStorageImpl { OLEStorageImpl(); - void initialize(SvStream* pStream); + void initialize(std::unique_ptr<SvStream> pStream); tools::SvRef<SotStorageStream> getStream(const rtl::OUString& rPath); tools::SvRef<SotStorageStream> const& getStream(std::size_t nId); @@ -178,12 +178,12 @@ OLEStorageImpl::OLEStorageImpl() { } -void OLEStorageImpl::initialize(SvStream* const pStream) +void OLEStorageImpl::initialize(std::unique_ptr<SvStream> pStream) { if (!pStream) return; - mxRootStorage.ref = new SotStorage(pStream, true); + mxRootStorage.ref = new SotStorage(pStream.release(), true); traverse(mxRootStorage.ref, ""); |