iphone - NSData memory leak...pointing to NSConcreteData! -


i having memory leak, , can't figure out. basically, doing here pulling in images mutable dictionary , returning dictionary.

- (nsmutabledictionary *)loadimagedatagroup:(nsuinteger)index {  int lim = 5; int sta = 0; if (index > lim) {     sta = index-lim; } int fin = (((lim*2)+1)+sta); if (fin > [self imagecount]) {     sta = ([self imagecount]-((lim*2)-1));     fin = [self imagecount]; }  bool firsttime = no; if ([imagesloaded count] == 0) {     firsttime = yes; }  nsmutabledictionary *tempdict = [[[nsmutabledictionary alloc] init] autorelease];  (int = sta; < fin; i++) {      nsstring *imagename = [self imagenameatindex:i];      if ([imagesloaded valueforkey:imagename] == nil) {          // memory leak...at least leaks pointing me.         nsdata *imagedata = [nsdata datawithcontentsofurl:[nsurl urlwithstring:imagename]];         [tempdict setobject:imagedata forkey:imagename];      } else {         [tempdict setobject:[imagesloaded valueforkey:imagename] forkey:imagename];     }  }  return tempdict; 

}

the leak in nsdata = *imagedata spot, , when pull in leaks, points nsconcretedata.

looking @ code, i'm not seeing wrong. aware instruments can produce false positives.

see following:

instruments showing false leak?


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -