Multiple leaked objects in - (void)runPACScript:(NSString *)script

191 views
Skip to first unread message

elviin

unread,
May 6, 2012, 9:38:39 AM5/6/12
to ASIHTTPRequest
Hi

I've profiled my application and I can not fix the lines in -
(void)runPACScript:(NSString *)script so that the profiling
application "Instruments" does not report leaked objects in this
method. XCode 4.3.2, iOS 5.1.

The line responsible for the leaks is
NSArray *proxies =
[NSMakeCollectable(CFNetworkCopyProxiesForAutoConfigurationScript((CFStringRef)script,
(CFURLRef)[self url], &err)) autorelease];

I tried to release the CFArrayRef returned from
CFNetworkCopyProxiesForAutoConfigurationScript myself, using the
__bridge cast or CFBridgingRelease but the retain count of the array
is still 1. If I autorelease it then I get double free call fot the
object.

Part of the report from Instruments:

Leaked Object # Address Size Responsible Library Responsible Frame
CFRunLoopSource, 1 0x63c770 112 Bytes My App -[ASIHTTPRequest
runPACScript:]
CFBag, 1 0x655600 48 Bytes My App -[ASIHTTPRequest
runPACScript:]
Malloc 64 Bytes, 1 0x6fbb50 64 Bytes My App -[ASIHTTPRequest
runPACScript:]
Malloc 16 Bytes, 1 0x61eaf0 16 Bytes My App -[ASIHTTPRequest
runPACScript:]
Malloc 64 Bytes, 1 0x6101f0 64 Bytes My App -[ASIHTTPRequest
runPACScript:]
Malloc 16 Bytes, 1 0x614100 16 Bytes My App -[ASIHTTPRequest
runPACScript:]

I think the code is correct. The profiling was made on real device,
iOS5.1.

Thank you for a hint.





Reply all
Reply to author
Forward
0 new messages