2010-8-9

NSData dataWithContentsOfURL has memory leak problem

NSData dataWithContentsOfURL has memory leak problem.

Should use it like below.

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

// ** Your Operations **

NSData *data = [NSData dataWithContentsOfURL:someURL];

// ** Your Operation **

[pool release];

0 评论: