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>
This commit is contained in:
Noel
2021-02-23 12:11:31 +01:00
committed by Noel Grandin
parent c181e510c5
commit c13133b613
8 changed files with 77 additions and 18 deletions
+3 -3
View File
@@ -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