|
|
@ -108,8 +108,7 @@ pub fn set_panic_hook(use_stderr: bool) { |
|
|
|
|
|
|
|
|
|
|
|
// If we get a `WouldBlock` error, we know that the `Gfx` service has been initialized.
|
|
|
|
// If we get a `WouldBlock` error, we know that the `Gfx` service has been initialized.
|
|
|
|
// Otherwise fallback to printing over stderr.
|
|
|
|
// Otherwise fallback to printing over stderr.
|
|
|
|
match GFX_ACTIVE.try_lock() { |
|
|
|
if let Err(TryLockError::WouldBlock) = GFX_ACTIVE.try_lock() { |
|
|
|
Err(TryLockError::WouldBlock) => { |
|
|
|
|
|
|
|
if use_stderr { |
|
|
|
if use_stderr { |
|
|
|
print_to_stderr(name, panic_info); |
|
|
|
print_to_stderr(name, panic_info); |
|
|
|
} |
|
|
|
} |
|
|
@ -123,11 +122,9 @@ pub fn set_panic_hook(use_stderr: bool) { |
|
|
|
unsafe { |
|
|
|
unsafe { |
|
|
|
popup.launch_unchecked(); |
|
|
|
popup.launch_unchecked(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
_ => { |
|
|
|
|
|
|
|
print_to_stderr(name, panic_info); |
|
|
|
print_to_stderr(name, panic_info); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
})); |
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
fn print_to_stderr(name: &str, panic_info: &std::panic::PanicInfo) { |
|
|
|
fn print_to_stderr(name: &str, panic_info: &std::panic::PanicInfo) { |
|
|
|