diff options
author | Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com> | 2020-03-18 02:20:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-18 02:20:56 +0100 |
commit | 471089e9b01216fd5a2dd2def3e8a845370ed1f2 (patch) | |
tree | 6513402706d55505ec57cf88c97db5633ffabb9a /modules/mono/glue | |
parent | 989a223c5a6d6ba5b1b098be8983888cb49b2525 (diff) | |
parent | 0b814ea78d6b065e8e0785155207bd80b3d845c8 (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.cpp | 8 |
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); } } |