Memory leak using (void) alloc

Posted by Rudiger on Stack Overflow See other posts from Stack Overflow or by Rudiger
Published on 2010-03-23T03:30:11Z Indexed on 2010/03/23 5:01 UTC
Read the original article Hit count: 416

Filed under:
|

I have seen a similar line of code floating about in Apples code:

(void)[[URLRequest alloc] initializeRequestWithValues:postBody url:verifySession httpHeader:nil delegate:self];

URLRequest is my own custom class. I didn't write this and I think the guy that did just grabbed it from Apple's example. To me this should leak and when I test it I'm pretty sure it leaks 16 bytes. Would it? I know how to fix it if it does but wasn't sure as it was taken from Apple's code.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about memory-leaks