How do I catch exceptions thrown from the main application frame (the MyFrame class in my case)? On XP this works fine but on Linux I get a segfault (the exception just isn't caught).
Where can I find an example that shows me how to get around this?
Thanks!
Gerald
How to catch bad_alloc (or other exceptions) on Linux? Topic is solved
-
- Earned a small fee
- Posts: 20
- Joined: Wed Apr 11, 2007 12:00 am
- Location: U.S.A.
- Contact:
have you tried calling
::wxHandleFatalExceptions( true );
and overriding
wxApp::OnFatalException?
I think the "except" sample in the samples directory shows how to use it.
I believe I've used it in the past and it worked for my segfaults, I don't have anything using it right now. std::bad_alloc should be able to be caught in an ordinary catch() statement, I've got code that currently does that.
Outside of wxWidgets I've used sigaction() to set a signal
handler for SIGSEGV (and some other signals).
If you're gettting segfaults, you are better off finding the cause in a debugger and making sure they don't happen.
::wxHandleFatalExceptions( true );
and overriding
wxApp::OnFatalException?
I think the "except" sample in the samples directory shows how to use it.
I believe I've used it in the past and it worked for my segfaults, I don't have anything using it right now. std::bad_alloc should be able to be caught in an ordinary catch() statement, I've got code that currently does that.
Outside of wxWidgets I've used sigaction() to set a signal
handler for SIGSEGV (and some other signals).
If you're gettting segfaults, you are better off finding the cause in a debugger and making sure they don't happen.