From 23093b9c531b7ecf2e19f25d5c9f5a1b7a43f850 Mon Sep 17 00:00:00 2001 From: Mazyad Alabduljaleel Date: Wed, 25 Feb 2015 10:56:25 +0400 Subject: [PATCH] Just a few more leak fixes --- cocos/network/HttpAsynConnection.m | 8 ++++---- cocos/network/HttpClient-ios.mm | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos/network/HttpAsynConnection.m b/cocos/network/HttpAsynConnection.m index 5c58cb5ab4..1be9ff2fdd 100755 --- a/cocos/network/HttpAsynConnection.m +++ b/cocos/network/HttpAsynConnection.m @@ -63,14 +63,14 @@ NSLog(@"Starting to load %@", srcURL); finish = false; - self.responseData = [NSMutableData new]; + self.responseData = [NSMutableData data]; getDataTime = 0; self.responseError = nil; // create the connection with the target request and this class as the delegate - self.conn = [[NSURLConnection alloc] initWithRequest:request - delegate:self - startImmediately:NO]; + self.conn = [[[NSURLConnection alloc] initWithRequest:request + delegate:self + startImmediately:NO] autorelease]; [self.conn scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; diff --git a/cocos/network/HttpClient-ios.mm b/cocos/network/HttpClient-ios.mm index 6c87780b88..29b55d4108 100644 --- a/cocos/network/HttpClient-ios.mm +++ b/cocos/network/HttpClient-ios.mm @@ -281,7 +281,7 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream } //handle response header - NSMutableString *header = [NSMutableString new]; + NSMutableString *header = [NSMutableString string]; [header appendFormat:@"HTTP/1.1 %ld %@\n", (long)httpAsynConn.responseCode, httpAsynConn.statusString]; for (id key in httpAsynConn.responseHeader) {