Skip to content

Commit 92016fa

Browse files
committed
Move panic hook to OfxGetPlugin
Thanks to Self-Directed Research for taking an interest in this!
1 parent 93e533d commit 92016fa

File tree

1 file changed

+5
-5
lines changed
  • crates/openfx-plugin/src

1 file changed

+5
-5
lines changed

crates/openfx-plugin/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,11 +1627,6 @@ unsafe extern "C" fn main_entry(
16271627
let effect = handle as OfxImageEffectHandle;
16281628
let action = CStr::from_ptr(action);
16291629

1630-
// Needed so Resolve doesn't swallow the panic info
1631-
std::panic::set_hook(Box::new(|info| {
1632-
println!("{:?}", info);
1633-
}));
1634-
16351630
let return_status = if action == kOfxActionLoad {
16361631
action_load()
16371632
} else if action == kOfxActionDescribe {
@@ -1672,6 +1667,11 @@ pub extern "C" fn OfxGetPlugin(nth: c_int) -> *const OfxPlugin {
16721667
return ptr::null();
16731668
}
16741669

1670+
// Needed so Resolve doesn't swallow the panic info
1671+
std::panic::set_hook(Box::new(|info| {
1672+
println!("{:?}", info);
1673+
}));
1674+
16751675
// Use the minor and patch versions for the OFX major and minor versions respectively so this can still be a
16761676
// 0.x crate (may contain breaking changes)
16771677
const VERSION_MINOR: &str = env!("CARGO_PKG_VERSION_MINOR");

0 commit comments

Comments
 (0)