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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user