Fixes warning: weak receiver may be unpredictably null in ARC mode [-Werror,-Wreceiver-is-weak]

This commit is contained in:
Oliver Jones 2012-11-29 18:30:28 +11:00
parent f9449753ff
commit 23b8fe33ba

View file

@ -215,8 +215,10 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
} else {
__weak __typeof(&*self)weakSelf = self;
[super setCompletionBlock:^ {
__typeof(&*weakSelf) operation = weakSelf;
block();
[weakSelf setCompletionBlock:nil];
[operation setCompletionBlock:nil];
}];
}
[self.lock unlock];