CFNetwork / NSURLConnection leak

Posted by JK on Stack Overflow See other posts from Stack Overflow or by JK
Published on 2010-03-13T16:54:55Z Indexed on 2010/05/13 6:54 UTC
Read the original article Hit count: 446

Filed under:
|
|

Running instruments on the device, I intermittently incur a memory leak of exactly 3.5 KB in CFNetwork, the responsible frame being "HostLookup_Master::HostLookup...."

I have read a number of questions re this issue and have separately tried the following to fix the leak:

  1. Included the following in applicationDidFinishLaunching:

    NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]; [NSURLCache setSharedURLCache:sharedCache]; [sharedCache release];

  2. Specified in the urlrequest not to load from the local cache.

None of the above worked. My class that instantiates the connections does not leak as its instances are released when data has been downloaded. I have verified this by confirming the the living objects of the class is 0 using Instruments.

Any advice on addressing this leak would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa-touch