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 7118691 commit 553c168Copy full SHA for 553c168
godot-core/src/obj/base.rs
@@ -246,6 +246,13 @@ impl<T: GodotClass> Base<T> {
246
"Base unexpectedly had its strong ref rug-pulled"
247
);
248
249
+ // Editor creates instances of given class for various purposes (getting class docs, default values...)
250
+ // and frees them instantly before our callable can be executed.
251
+ // Perform "weak" drop instead of "strong" one iff our instance is no longer valid.
252
+ if !instance_id.lookup_validity() {
253
+ strong_ref.unwrap().drop_weak();
254
+ }
255
+
256
// Triggers RawGd::drop() -> dec-ref -> possibly object destruction.
257
});
258
}
0 commit comments