![]() |
|
Question about AutoreleasePool on GLImageWall Example - Printable Version +- iDevGames Forums (http://www.idevgames.com/forums) +-- Forum: Development Zone (/forum-3.html) +--- Forum: Graphics & Audio Programming (/forum-9.html) +--- Thread: Question about AutoreleasePool on GLImageWall Example (/thread-3185.html) |
Question about AutoreleasePool on GLImageWall Example - bonanza - Jul 13, 2007 04:49 AM Hi, in the GLImageWall Example in SplitterBox.m is the following Code: Code: //Main Event LoopWhy is there an AutoreleasePool ??? Question about AutoreleasePool on GLImageWall Example - ThemsAllTook - Jul 13, 2007 05:26 AM If your code is spinning in a busy loop for a long time (and allocating objects), an autorelease pool is useful to make sure autoreleased objects don't pile up and go nowhere. The autorelease pool created for you by NSApplicationMain() doesn't empty itself until you return to the main event loop, which this code won't do while the view is full screen, which means it's likely to be a very long time. Without the autorelease pool in that code, application memory would grow continuously in the loop (unless nothing in the loop calls or causes any autoreleases at all). Question about AutoreleasePool on GLImageWall Example - bonanza - Jul 13, 2007 05:32 AM Thanks you for this |