diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-10 20:33:16 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-23 12:11:31 +0100 |
commit | c13133b613fda3255fab60c03012aff93a5f2f02 (patch) | |
tree | b07846fbcb4bac7c3a24f0570f60b1b6e759fd8f /cpputools | |
parent | c181e510c5f5e74f1f6824b64637849aace9ae63 (diff) |
loplugin:refcounting check for managing OWeakObject with raw pointer
Change-Id: I7471725f1e658940b5e6993361c327be6ccf0d31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111064
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cpputools')
-rw-r--r-- | cpputools/source/unoexe/unoexe.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index bc1df676a38a..b5be9ff175ff 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -30,6 +30,7 @@ #include <rtl/string.h> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> +#include <rtl/ref.hxx> #include <cppuhelper/bootstrap.hxx> #include <cppuhelper/implbase.hxx> @@ -344,11 +345,10 @@ void ODisposingListener::disposing( const EventObject & ) void ODisposingListener::waitFor( const Reference< XComponent > & xComp ) { - ODisposingListener * pListener = new ODisposingListener; - Reference< XEventListener > xListener( pListener ); + rtl::Reference<ODisposingListener> xListener = new ODisposingListener; xComp->addEventListener( xListener ); - pListener->cDisposed.wait(); + xListener->cDisposed.wait(); } } // namespace unoexe |