mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-14 06:58:35 +00:00
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:
parent
3e9c14a2a0
commit
8fc605ed84
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user