On Sunday, June 15, 2003, at 07:35 pm, Dan Hitt wrote:
I'm still unclear about when temporary strings get free'd (other
than when the pool they come from gets free'd), and i'd appreciate
any pointers from anybody on just what the connection is between
the autorelease pool one creates in main() and its eventual usage
(and how it gets passed around), but for now i can just use alloc/init...
code.
The autorelease pool in main() is used as a catchall ... to ensure that objects not created in other pools last for the lifetime of the program.
The autorelease pools are not normally used directly, instead the -autorelease method (which all objects inherit from NSObject) is generally called. This method adds the receiver to the newest autorelease pool in the executing thread.
May methods create and destroy autorelease pools, so that any temporary objects they create are destroyed before they return.
You can do the same in your own code.
_______________________________________________ Help-gnustep mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-gnustep
