Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

namanhams

macrumors regular
Original poster
Jun 3, 2009
153
0
Hi everyone,

I use Instrument to detect memory leak and i found that there's a leak everytime i use the JSONValue method.

Any idea about this ?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Could be a false positive, and it could be a bug in your code. Kind of hard to tell without any code.
 

namanhams

macrumors regular
Original poster
Jun 3, 2009
153
0
Here's the code :

Code:
NSData *resultData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *resultString = [[NSString alloc] initWithData:resultData encoding:NSUTF8StringEncoding];
NSArray *formList = [resultString JSONValue];

[resultString release];

The Instrument pointed out that the third line has memory leak.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.