Tidied code

This commit is contained in:
Richard Frith-Macdonald 2020-09-30 09:55:43 +01:00
parent f381b5f09b
commit 6ae48bd3d3

View file

@ -41,22 +41,24 @@
if (((self = [super init])) != nil)
{
[inv retainArguments];
_invocation = [inv retain];
_invocation = RETAIN(inv);
}
return self;
}
- (id) initWithTarget: (id)target selector: (SEL)aSelector object: (id)arg
{
NSMethodSignature *methodSignature;
NSInvocation *inv;
NSMethodSignature *methodSignature;
NSInvocation *inv;
methodSignature = [target methodSignatureForSelector: aSelector];
inv = [NSInvocation invocationWithMethodSignature: methodSignature];
[inv setTarget: target];
[inv setSelector: aSelector];
if ([methodSignature numberOfArguments] > 2)
[inv setArgument: &arg atIndex: 2];
{
[inv setArgument: &arg atIndex: 2];
}
return [self initWithInvocation: inv];
}
@ -65,16 +67,20 @@
if (![self isCancelled])
{
NS_DURING
[_invocation invoke];
{
[_invocation invoke];
}
NS_HANDLER
_exception = [localException copy];
{
ASSIGN(_exception, localException);
}
NS_ENDHANDLER
}
}
- (NSInvocation *) invocation
{
return [[_invocation retain] autorelease];
return AUTORELEASE(RETAIN(_invocation));
}
- (id) result
@ -123,8 +129,8 @@
- (void) dealloc
{
[_invocation release];
[_exception release];
DESTROY(_invocation);
DESTROY(_exception);
[super dealloc];
}