diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/ctrl.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
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<Control> 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; } |