diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-10-26 10:43:53 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-10-26 23:12:59 +0200 |
commit | f8799964a0d2a3cbc07c7edde6f17b57f9c93e4f (patch) | |
tree | 2430fd4551e9bbeb5a2dd4fbd3a9a9b9b381241a /sfx2 | |
parent | 58edf898989c8cba7e05bdac90db812a52ea03f2 (diff) |
Fix a memory leak
...introduced with 5d5da77e82b6498dd73123ec0dc36d2315e279a1 "tdf#116305 Add
timeout to help Windows bring browsers to the front". (And remove a redundant
return statement, which had originally been `return true;`.)
Change-Id: Idf7fe33b25cd243e31eea460e4af325c84dae88b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124174
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/openuriexternally.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx index f3f6edf11eee..d149f63d257d 100644 --- a/sfx2/source/appl/openuriexternally.cxx +++ b/sfx2/source/appl/openuriexternally.cxx @@ -77,13 +77,13 @@ void URITools::openURI(const OUString& sURI, bool bHandleSystemShellExecuteExcep IMPL_LINK_NOARG(URITools, onOpenURI, Timer*, void) { + std::unique_ptr<URITools> guard(this); css::uno::Reference< css::system::XSystemShellExecute > exec( css::system::SystemShellExecute::create(comphelper::getProcessComponentContext())); try { exec->execute( msURI, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY); - return; } catch (css::lang::IllegalArgumentException & e) { if (e.ArgumentPosition != 0) { throw css::uno::RuntimeException( @@ -112,7 +112,6 @@ IMPL_LINK_NOARG(URITools, onOpenURI, Timer*, void) //TODO: avoid subsequent replaceFirst acting on previous replacement eb->run(); } - delete this; } void sfx2::openUriExternally(const OUString& sURI, bool bHandleSystemShellExecuteException) |