Don't end frame normally when panicking

igEndFrame might end up doing an assert that aborts the process, which
prevents the panic handler from doing its job.
This commit is contained in:
Joonas Javanainen 2019-04-21 00:06:16 +03:00
parent 3e9c14a2a0
commit 8fc605ed84
No known key found for this signature in database
GPG Key ID: D39CCA5CB19B9179

View File

@ -6,6 +6,7 @@ use std::os::raw::{c_char, c_float, c_int, c_uchar, c_void};
use std::ptr;
use std::slice;
use std::str;
use std::thread;
use sys::ImGuiStyleVar;
pub use self::child_frame::ChildFrame;
@ -588,7 +589,7 @@ impl<'ui> Ui<'ui> {
impl<'a> Drop for Ui<'a> {
fn drop(&mut self) {
if self.needs_cleanup {
if self.needs_cleanup && !thread::panicking() {
unsafe {
sys::igEndFrame();
CURRENT_UI = None;