We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b61c4f4 commit de25cc7Copy full SHA for de25cc7
godot-core/src/obj/base.rs
@@ -96,8 +96,11 @@ impl<T: GodotClass> Base<T> {
96
/// `base` must be alive at the time of invocation, i.e. user `init()` (which could technically destroy it) must not have run yet.
97
/// If `base` is destroyed while the returned `Base<T>` is in use, that constitutes a logic error, not a safety issue.
98
pub(crate) unsafe fn from_base(base: &Base<T>) -> Base<T> {
99
- #[cfg(safeguards_strict)]
100
- assert!(base.obj.is_instance_valid());
+ #[cfg(safeguards_balanced)]
+ assert!(
101
+ base.obj.is_instance_valid(),
102
+ "Cannot construct Base; was object freed during initialization?"
103
+ );
104
105
let obj = Gd::from_obj_sys_weak(base.obj.obj_sys());
106
0 commit comments