Skip to content

Commit 81e672e

Browse files
committed
Fixed a static analyzer issue
1 parent 0fa83f6 commit 81e672e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/OAuth2Client/NXOAuth2Connection.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
@interface NXOAuth2Connection ()
18-
+ (NSURLConnection *)createStartedConnectionWithRequest:(NSURLRequest *)aRequest connectionDelegate:(id)connectionDelegate streamDelegate:(id)streamDelegate client:(NXOAuth2Client *)theClient;
18+
+ (NSURLConnection *)startedConnectionWithRequest:(NSURLRequest *)aRequest connectionDelegate:(id)connectionDelegate streamDelegate:(id)streamDelegate client:(NXOAuth2Client *)theClient;
1919
@end
2020

2121

@@ -34,7 +34,7 @@ - (id)initWithRequest:(NSURLRequest *)aRequest
3434
client = [aClient retain]; // TODO: check if assign is better here
3535

3636
request = [aRequest copy];
37-
connection = [[self class] createStartedConnectionWithRequest:request connectionDelegate:self streamDelegate:self client:client];
37+
connection = [[[self class] startedConnectionWithRequest:request connectionDelegate:self streamDelegate:self client:client] retain];
3838
}
3939
return self;
4040
}
@@ -72,13 +72,13 @@ - (void)retry;
7272
{
7373
[self cancel];
7474
[connection release];
75-
connection = [[self class] createStartedConnectionWithRequest:request connectionDelegate:self streamDelegate:self client:client];
75+
connection = [[[self class] startedConnectionWithRequest:request connectionDelegate:self streamDelegate:self client:client] retain];
7676
}
7777

7878

7979
#pragma mark Private
8080

81-
+ (NSURLConnection *)createStartedConnectionWithRequest:(NSURLRequest *)aRequest connectionDelegate:(id)connectionDelegate streamDelegate:(id)streamDelegate client:(NXOAuth2Client *)theClient;
81+
+ (NSURLConnection *)startedConnectionWithRequest:(NSURLRequest *)aRequest connectionDelegate:(id)connectionDelegate streamDelegate:(id)streamDelegate client:(NXOAuth2Client *)theClient;
8282
{
8383
NSMutableURLRequest *startRequest = [[aRequest mutableCopy] autorelease];
8484

@@ -95,7 +95,7 @@ + (NSURLConnection *)createStartedConnectionWithRequest:(NSURLRequest *)aRequest
9595
NSURLConnection *aConnection = [[NSURLConnection alloc] initWithRequest:startRequest delegate:connectionDelegate startImmediately:NO]; // don't start yet
9696
[aConnection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; // let's first schedule it in the current runloop. (see http://github.com/soundcloud/cocoa-api-wrapper/issues#issue/2 )
9797
[aConnection start]; // now start
98-
return aConnection;
98+
return [aConnection autorelease];
9999
}
100100

101101

0 commit comments

Comments
 (0)