summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-06-28 17:26:44 +0200
committerGitHub <noreply@github.com>2022-06-28 17:26:44 +0200
commit622b656c40f9d8d9c8fdd45d6727f416952636d7 (patch)
tree3f725349ae1715e32441aae96271795d9f153e33 /core
parent2ea7765f7678cb187f15cf4bf585a2f5536f94c3 (diff)
parent6141ce2cb8ae54965190257a1ffd6a6abd02aaea (diff)
Merge pull request #53135 from briansemrau/fix-ref-leak
Diffstat (limited to 'core')
-rw-r--r--core/variant/variant_internal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/variant/variant_internal.h b/core/variant/variant_internal.h
index 3696ffae60..e0cfb42e1e 100644
--- a/core/variant/variant_internal.h
+++ b/core/variant/variant_internal.h
@@ -304,6 +304,13 @@ public:
v->_get_obj().id = ObjectID();
}
+ static void update_object_id(Variant *v) {
+ const Object *o = v->_get_obj().obj;
+ if (o) {
+ v->_get_obj().id = o->get_instance_id();
+ }
+ }
+
_FORCE_INLINE_ static void *get_opaque_pointer(Variant *v) {
switch (v->type) {
case Variant::NIL: