JSON framework : JSONValue memory leak

Discussion in 'iOS Programming' started by namanhams, Jul 4, 2009.

  1. namanhams macrumors regular

    Jun 3, 2009
    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 ?
  2. kainjow Moderator emeritus


    Jun 15, 2000
    Could be a false positive, and it could be a bug in your code. Kind of hard to tell without any code.
  3. namanhams thread starter macrumors regular

    Jun 3, 2009
    Here's the 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.

Share This Page