From 94cd5204e302950038278f3828a2d98c51361167 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 8 May 2015 12:20:18 +0100 Subject: vcl: Control - hold a VclPtr instead of a dogtag over emission. Change-Id: Ibedf2fc25ac141e10d07ba757fa6c76a4c4a6cff --- vcl/source/control/ctrl.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'vcl') diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index af9b3d4f8ce4..34c424856f86 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -324,21 +324,18 @@ void Control::AppendLayoutData( const Control& rSubControl ) const } } -bool Control::ImplCallEventListenersAndHandler( sal_uLong nEvent, const Link<>& rHandler, void* pCaller ) +bool Control::ImplCallEventListenersAndHandler( sal_uLong nEvent, const Link<>& rHandler, void* pCaller ) { - ImplDelData aCheckDelete; - ImplAddDel( &aCheckDelete ); + VclPtr xThis(this); CallEventListeners( nEvent ); - if ( !aCheckDelete.IsDead() ) + + if ( !xThis->IsDisposed() ) { rHandler.Call( pCaller ); - if ( !aCheckDelete.IsDead() ) - { - ImplRemoveDel( &aCheckDelete ); + if ( !xThis->IsDisposed() ) return false; - } } return true; } -- cgit