mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-20 13:39:22 +00:00
CPAnimationContext setCompletionHandler: add an equality check
This commit is contained in:
1 parent
bb2d860807
commit
dc87354702
1 file changed
+17
-2
@@ -367,9 +367,24 @@ var _CPAnimationContextStack = nil,
|
||||
- (void)setCompletionHandler:(Function)aCompletionHandler
|
||||
{
|
||||
if (_completionHandlerAgent)
|
||||
_completionHandlerAgent.invalidate();
|
||||
{
|
||||
if (aCompletionHandler === _completionHandlerAgent._completionHandler)
|
||||
return;
|
||||
|
||||
_completionHandlerAgent = aCompletionHandler ? (new CompletionHandlerAgent(aCompletionHandler)) : nil;
|
||||
_completionHandlerAgent.invalidate();
|
||||
}
|
||||
|
||||
if (aCompletionHandler)
|
||||
{
|
||||
_completionHandlerAgent = new CompletionHandlerAgent(aCompletionHandler);
|
||||
#if (DEBUG)
|
||||
CPLog.debug("created a new completion Agent with id " + _completionHandlerAgent.id);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
_completionHandlerAgent = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)completionHandler
|
||||
|
||||
Reference in new issue
Block a user