JSON framework : JSONValue memory leak

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

  1. namanhams macrumors regular

    Joined:
    Jun 3, 2009
    #1
    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

    kainjow

    Joined:
    Jun 15, 2000
    #2
    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

    Joined:
    Jun 3, 2009
    #3
    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.
     

Share This Page