Re: Stack unwinding with Objective C++
Re: Stack unwinding with Objective C++
- Subject: Re: Stack unwinding with Objective C++
- From: Chris Hanson <email@hidden>
- Date: Sun, 6 Nov 2005 16:40:42 -0800
On Nov 6, 2005, at 2:49 PM, Tommy Nordgren wrote:
Is there any additional command line option I can pass to the
compiler, when writing Cocoa Apps in
Objective C++, that will generate proper destuctor calls of C++
objects when unwinding the stack on
thrown exceptions. (I've tried with both C++ and Objective C
exception handling systems - in neither
case I get calls of the destructor)
Objective-C++ lets you mix Objective-C and C++ at the statement
level. It doesn't integrate the runtimes of the two languages to any
but the most limited extent.
In Mac OS X 10.4 with GCC 4, that's been extended to include calling C
++ constructors and destructors for non-pointer objects declared as
part of an Objective-C object. (The -fobjc-call-cxx-cdtors compiler
flag.)
The exception-handling systems are still distinct. The Objective-C
setjmp-based system won't invoke C++ destructors or otherwise unwind C
++ state. That said, between a C++ exception and its corresponding
catch, C++ destructors should be invoked.
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden