mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-27 21:38:34 +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::ptr;
|
||||||
use std::slice;
|
use std::slice;
|
||||||
use std::str;
|
use std::str;
|
||||||
|
use std::thread;
|
||||||
use sys::ImGuiStyleVar;
|
use sys::ImGuiStyleVar;
|
||||||
|
|
||||||
pub use self::child_frame::ChildFrame;
|
pub use self::child_frame::ChildFrame;
|
||||||
@ -588,7 +589,7 @@ impl<'ui> Ui<'ui> {
|
|||||||
|
|
||||||
impl<'a> Drop for Ui<'a> {
|
impl<'a> Drop for Ui<'a> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if self.needs_cleanup {
|
if self.needs_cleanup && !thread::panicking() {
|
||||||
unsafe {
|
unsafe {
|
||||||
sys::igEndFrame();
|
sys::igEndFrame();
|
||||||
CURRENT_UI = None;
|
CURRENT_UI = None;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user