Hi m,

On Mon, Apr 6, 2009 at 8:21 AM, m <mlist0...@gmail.com> wrote:
> I've uploaded a project that demonstrates the problem to
>
> <http://uielement.muratnkonar.com/UIElement.zip>

The problem is that you set-up your callback and your actual callback
is all via C; it's not an Objective-C interface so it makes no
guarantee that an autorelease pool will even exist, let alone whether
it will drain it. Bear in mind, that when your events are triggered no
other Objective-C code runs except for yours; it's all done in
CoreFoundation's runloop code.

Anyway, to solve it, all your callbacks should create their own
autorelease pool and release them before returning. Likewise, if you
care about exceptions, you should catch them in your callback
functions, although if all you're going to do is terminate anyway,
letting your program crash is as good a way as any.

Kind regards,

Chris
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to