[vlc-devel] PATCH: OS X remove the use of setjmp()/longjmp()

Pierre d'Herbemont pdherbemont at free.fr
Sat Dec 26 17:16:46 CET 2009

On Sat, Dec 26, 2009 at 4:52 PM, Brian Weaver <cmdrclueless at gmail.com> wrote:
> It should if it did before; from a logical perspective it works the
> same as before. Previously the code was using setjmp()/longjmp() to
> return control back to the caller of NSApp run(). By invoking the
> 'stop' selector instead of 'quit' the Cocoa framework will return
> control after processing the stop event. It accomplishes the same end
> result, but avoid any potential side effects from using jump routines
> in a managed run time environment.

Sure, but when you select the Quit menu from the Dock it sends a -(id)
terminate:, so you'll need to send a -stop from here. Or so I believe,
that was the question asked :-)

> I'm mainly concerned with Objective-C 2.0 which allows for automatic
> garbage collection.

We don't support Garbage Collection nor Objective-C 2.0 there, so it's
no big deal :-) The overhead to support garbage collection without
leaking is too important to be considered for a near future.

> Also, I believe the use of 'stop' is easier to
> understand than the use of the setjmp() / longjmp().

It is!


More information about the vlc-devel mailing list