[Mono-osx] NSAutoreleasePool

Geoff Norton gnorton at novell.com
Fri Apr 22 21:14:58 EDT 2011


MonoMac is identical.  The main thread has a pool already setup for you, all async/user threads need one created by you.

-g

On 2011-04-13, at 5:44 AM, evanogainen wrote:

> I've been programming with MonoMac and I noticed a lot of NSAutorelease leaks
> due to there not being an Autorelease Pool in place.
> 
> Over in Xcode/ObjC the main thread has an autorelease pool created
> automatically, but for other threads the programmer has to manually create
> and dispose of one.
> 
> I would have thought that MonoMac would wrap this where required to make it
> more like .NET, tho it would seem that perhaps it isn't doing this.
> 
> Obviously I know I can create a new pool myself just like in ObjC, but I'm
> not actually explicitly creating any threads myself, so I'd have thought
> that I'd not have to create any autorelease pools myself.
> 
> So what is going on with this... how is the NSautorelease pool supposed to
> be used in MonoMac... is there even one created for the main thread, and
> should there be one created by the basic monomac application template for a
> Window app ?
> 
> 
> Andi
> 
> --
> View this message in context: http://mono.1490590.n4.nabble.com/NSAutoreleasePool-tp3446721p3446721.html
> Sent from the Mono - OSX mailing list archive at Nabble.com.
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx



More information about the Mono-osx mailing list