diff options
author | Ignacio Roldán Etcheverry <ignalfonsore@gmail.com> | 2021-08-16 17:16:36 +0200 |
---|---|---|
committer | Ignacio Roldán Etcheverry <ignalfonsore@gmail.com> | 2021-08-16 17:16:36 +0200 |
commit | 5ea500e599dabaf7c0826ecb37040ecb4f695399 (patch) | |
tree | 70076d9dc012e8b2c841798635e5e19b101231c3 /core | |
parent | 3e7a545ecf9194891ef0fd774159ddfa4cebf5f6 (diff) |
Fix C# native instance bindings after recent re-write
This was needed after: 44691448911f1d29d4d79dbdd5553734761e57c4
Diffstat (limited to 'core')
-rw-r--r-- | core/object/object.cpp | 15 | ||||
-rw-r--r-- | core/object/object.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/core/object/object.cpp b/core/object/object.cpp index c191109a8f..2bb4b981b9 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -1811,6 +1811,21 @@ void *Object::get_instance_binding(void *p_token, const GDNativeInstanceBindingC return binding; } +bool Object::has_instance_binding(void *p_token) { + bool found = false; + _instance_binding_mutex.lock(); + for (uint32_t i = 0; i < _instance_binding_count; i++) { + if (_instance_bindings[i].token == p_token) { + found = true; + break; + } + } + + _instance_binding_mutex.unlock(); + + return found; +} + void Object::_construct_object(bool p_reference) { type_is_reference = p_reference; _instance_id = ObjectDB::add_instance(this); diff --git a/core/object/object.h b/core/object/object.h index 1f5e17c99f..6523105820 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -809,6 +809,7 @@ public: void *get_instance_binding(void *p_token, const GDNativeInstanceBindingCallbacks *p_callbacks); // Used on creation by binding only. void set_instance_binding(void *p_token, void *p_binding, const GDNativeInstanceBindingCallbacks *p_callbacks); + bool has_instance_binding(void *p_token); void clear_internal_resource_paths(); |