summaryrefslogtreecommitdiff
path: root/modules/mono/glue
diff options
context:
space:
mode:
authorIgnacio Roldán Etcheverry <neikeq@users.noreply.github.com>2020-03-18 02:20:56 +0100
committerGitHub <noreply@github.com>2020-03-18 02:20:56 +0100
commit471089e9b01216fd5a2dd2def3e8a845370ed1f2 (patch)
tree6513402706d55505ec57cf88c97db5633ffabb9a /modules/mono/glue
parent989a223c5a6d6ba5b1b098be8983888cb49b2525 (diff)
parent0b814ea78d6b065e8e0785155207bd80b3d845c8 (diff)
Merge pull request #34275 from neikeq/no-ref-gchandles
Mono/C#: Optimize the way we store GC handles for scripts
Diffstat (limited to 'modules/mono/glue')
-rw-r--r--modules/mono/glue/base_object_glue.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/mono/glue/base_object_glue.cpp b/modules/mono/glue/base_object_glue.cpp
index f7a2e7f1e7..120668d1ef 100644
--- a/modules/mono/glue/base_object_glue.cpp
+++ b/modules/mono/glue/base_object_glue.cpp
@@ -70,8 +70,8 @@ void godot_icall_Object_Disposed(MonoObject *p_obj, Object *p_ptr) {
if (data) {
CSharpScriptBinding &script_binding = ((Map<Object *, CSharpScriptBinding>::Element *)data)->get();
if (script_binding.inited) {
- Ref<MonoGCHandle> &gchandle = script_binding.gchandle;
- if (gchandle.is_valid()) {
+ MonoGCHandleData &gchandle = script_binding.gchandle;
+ if (!gchandle.is_released()) {
CSharpLanguage::release_script_gchandle(p_obj, gchandle);
}
}
@@ -117,8 +117,8 @@ void godot_icall_Reference_Disposed(MonoObject *p_obj, Object *p_ptr, MonoBoolea
if (data) {
CSharpScriptBinding &script_binding = ((Map<Object *, CSharpScriptBinding>::Element *)data)->get();
if (script_binding.inited) {
- Ref<MonoGCHandle> &gchandle = script_binding.gchandle;
- if (gchandle.is_valid()) {
+ MonoGCHandleData &gchandle = script_binding.gchandle;
+ if (!gchandle.is_released()) {
CSharpLanguage::release_script_gchandle(p_obj, gchandle);
}
}