-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add panic guards to extern "C" functions #68
Conversation
Previously folks used panic_unwind to also print the error/backtrace, is it desired to ignore these nowadays? |
I'd also be fine with Let me try adding it anyways |
thanks, having something to map panics in extern C functions to an I didn't follow what extra protection was provided by the Adding the |
This protects undefined behavior from occurring if the panic-handling code panics. |
Yeah, so keep the |
Ah, right, I see. If we're worried that the catch code might panic though, can we consider just using I'm also wondering if we should specifically catch around the application's |
For reference here, I rebased your changes @notgull and also updated the implementation of I've also put a I recently raised it as an issue in Winit because it's problematic that Winit's At some point we should probably throw appropriate Java exceptions via JNI instead. I haven't yet looked at putting a more precise catch around the application's (also re-ordered the separate change to consolidate the logging API, and squashed other related bits together) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few suggestions, but generally looks okay.
Co-authored-by: Robert Bragg <robert@sixbynine.org>
Prevents undefined behavior in the event that any functions panic.