Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
September 24, 2017, 06:57:33 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: Program 16.1  (Read 1427 times)
FogBurner
Newbie
*
Posts: 7


« on: May 27, 2010, 06:54:39 AM »


Apologies in advance for newbishness...

When returning for an error condition {("file does not exist"); return 1;} we do not drain the autopool.  Is this for a calling program to query the objects that may have caused the error or is it done for another reason?

Thanks
Logged
skochan
Administrator
Hero Member
*****
Posts: 3114



« Reply #1 on: May 27, 2010, 09:18:33 AM »

Technically speaking, the autorelease pool should be drained before any of the return statements in any of the examples in the chapter are executed.  That was an oversight. 

In reality, the application is terminating, so all memory gets released anyway.  However, to be consistent, the pool should be drained.

Cheers,

Steve Kochan
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents ゥ 2009 classroomM.com. All rights reserved.