summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-05-08 12:20:18 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-05-08 12:59:38 +0100
commit94cd5204e302950038278f3828a2d98c51361167 (patch)
tree8a88a663c3d3461839f3053461e9c3a73805f17c
parentf0bed251563113311d73312f0126bcf8852f888e (diff)
vcl: Control - hold a VclPtr instead of a dogtag over emission.
Change-Id: Ibedf2fc25ac141e10d07ba757fa6c76a4c4a6cff
-rw-r--r--vcl/source/control/ctrl.cxx13
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;
}