[Mono-osx] NSAutoreleasePool

evanogainen evanogainen at gmail.com
Wed Apr 13 05:44:43 EDT 2011

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 ?


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.

More information about the Mono-osx mailing list