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 --- cui/source/dialogs/hldocntp.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cui/source') diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index 962298168b49..96a2fcac3ed8 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -390,11 +390,11 @@ void SvxHyperlinkNewDocTp::DoApply () try { // check if file exists, warn before we overwrite it - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ ); + std::unique_ptr pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ ); bool bOk = pIStm && ( pIStm->GetError() == ERRCODE_NONE); - delete pIStm; + pIStm.reset(); if( bOk ) { -- cgit