diff --git a/godot-core/src/init/mod.rs b/godot-core/src/init/mod.rs index 94cfaeb27..90c19c410 100644 --- a/godot-core/src/init/mod.rs +++ b/godot-core/src/init/mod.rs @@ -68,8 +68,11 @@ pub unsafe fn __gdext_load_library( 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) }