Permalink
Browse files

Use strong pointer to connectionError to prevent crash due to error b…

…eing prematurely released.
  • Loading branch information...
1 parent afb7ef6 commit 46b2d7d83652249996ac6712dd3c937ba15da05f Owain R Hunt committed Jun 14, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 UAGithubEngine/UAGithubURLConnection.h
  2. +1 −1 UAGithubEngine/UAGithubURLConnection.m
@@ -24,6 +24,6 @@
@property (nonatomic, strong) NSString *identifier;
+ (id)asyncRequest:(NSURLRequest *)request success:(id(^)(NSData *, NSURLResponse *))successBlock failure:(id(^)(NSError *))failureBlock_;
-+ (id)asyncRequest:(NSURLRequest *)request success:(id(^)(NSData *, NSURLResponse *))successBlock error:(NSError **)error;
++ (id)asyncRequest:(NSURLRequest *)request success:(id(^)(NSData *, NSURLResponse *))successBlock error:(NSError *__strong *)error;
@end
@@ -37,7 +37,7 @@ + (id)asyncRequest:(NSURLRequest *)request success:(id(^)(NSData *, NSURLRespons
//});
}
-+ (id)asyncRequest:(NSURLRequest *)request success:(id(^)(NSData *, NSURLResponse *))successBlock error:(NSError *__autoreleasing *)error
++ (id)asyncRequest:(NSURLRequest *)request success:(id(^)(NSData *, NSURLResponse *))successBlock error:(NSError *__strong *)error
{
// This has to be dispatch_sync rather than _async, otherwise our successBlock executes before the request is done and we're all bass-ackwards.
//dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

0 comments on commit 46b2d7d

Please sign in to comment.