|
|
|
@ -108,8 +108,7 @@ pub fn set_panic_hook(use_stderr: bool) {
@@ -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.
|
|
|
|
|
// Otherwise fallback to printing over stderr.
|
|
|
|
|
match GFX_ACTIVE.try_lock() { |
|
|
|
|
Err(TryLockError::WouldBlock) => { |
|
|
|
|
if let Err(TryLockError::WouldBlock) = GFX_ACTIVE.try_lock() { |
|
|
|
|
if use_stderr { |
|
|
|
|
print_to_stderr(name, panic_info); |
|
|
|
|
} |
|
|
|
@ -123,11 +122,9 @@ pub fn set_panic_hook(use_stderr: bool) {
@@ -123,11 +122,9 @@ pub fn set_panic_hook(use_stderr: bool) {
|
|
|
|
|
unsafe { |
|
|
|
|
popup.launch_unchecked(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
_ => { |
|
|
|
|
} else { |
|
|
|
|
print_to_stderr(name, panic_info); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
fn print_to_stderr(name: &str, panic_info: &std::panic::PanicInfo) { |
|
|
|
|