• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
c++ exceptions causing abort
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

c++ exceptions causing abort


  • Subject: c++ exceptions causing abort
  • From: Benjohn <email@hidden>
  • Date: Mon, 13 Dec 2004 16:09:29 +0000


Our application uses some cross platform c++ code that can throw c++ exceptions. We would like to catch otherwise unhandled c++ exceptions close to the main event loop, and display a suitable error dialogue. This seems like it should be reasonably easy to do by using a custom NSApplication that replaces some methods with calls to the super object wrapped in a try catch block.


Having tried this though, it doesn't work. We have found that if a c++ throw and its catch are separated by App Kit or Foundation functions, the catch handler isn't called, and instead the program aborts.

ie:

	Our c++ code			- throw occurs here.
	Our c++ code
	Our c++ code
	App Kit / Foundation
	App Kit / Foundation
	App Kit / Foundation
	App Kit / Foundation
	Our handler			- catch here doesn't work.
	App Kit / Foundation
	App Kit / Foundation
	Root of the stack

We have a small project that will reproduce this.

We're getting a bit desperate for a solution or explanation, and have failed to find any leads. I wouldn't be surprised if we had some compiler flags set wrong, but we've not found anything that makes a difference.

Please could someone tell me if this is not possible (c++ exceptions can't be thrown through app kit / foundation methods, for eg). Alternatively, could someone confirm if it's definitely possible, and we must have something set up wrong.

Thanks very much,
	Benjohn

_______________________________________________
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


  • Follow-Ups:
    • Re: c++ exceptions causing abort
      • From: John Stiles <email@hidden>
  • Prev by Date: Text vertical spacing - Yet even more text woes
  • Next by Date: Re: Trouble reading a binary file.
  • Previous by thread: Text vertical spacing - Yet even more text woes
  • Next by thread: Re: c++ exceptions causing abort
  • Index(es):
    • Date
    • Thread