Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to linux_reload_workaround to allow calling is_hot_reload_enabled before enable_hot_reload #1040

7 changes: 5 additions & 2 deletions godot-core/src/init/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ pub unsafe fn __gdext_load_library<E: ExtensionLibrary>(
success as u8
};

let ctx = || "error when loading GDExtension library";
let is_success = crate::private::handle_panic(ctx, init_code);
// Use std::panic::catch_unwind instead of handle_panic: handle_panic uses TLS, which
// calls `thread_atexit` on linux, which sets the hot reloading flag on linux.
// Using std::panic::catch_unwind avoids this, although we lose out on context information
// for debugging.
let is_success = std::panic::catch_unwind(init_code);

is_success.unwrap_or(0)
}
Expand Down
Loading