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 /framework | |
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 'framework')
-rw-r--r-- | framework/source/fwe/classes/addonsoptions.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx index 8c45c86157ea..136cc7c26984 100644 --- a/framework/source/fwe/classes/addonsoptions.cxx +++ b/framework/source/fwe/classes/addonsoptions.cxx @@ -1277,7 +1277,7 @@ Image AddonsOptions_Impl::ReadImageFromURL(const OUString& aImageURL) { Image aImage; - SvStream* pStream = UcbStreamHelper::CreateStream( aImageURL, StreamMode::STD_READ ); + std::unique_ptr<SvStream> pStream = UcbStreamHelper::CreateStream( aImageURL, StreamMode::STD_READ ); if ( pStream && ( pStream->GetErrorCode() == ERRCODE_NONE )) { // Use graphic class to also support more graphic formats (bmp,png,...) @@ -1299,8 +1299,6 @@ Image AddonsOptions_Impl::ReadImageFromURL(const OUString& aImageURL) } } - delete pStream; - return aImage; } |