diff options
author | Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com> | 2021-12-23 13:36:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-23 13:36:04 +0100 |
commit | 54d89f2274328cbf0fd63ad01c0a203c9b0f5c62 (patch) | |
tree | 7c591e5bb44f5b8a60b37b74ec07cdbe0b077019 | |
parent | 1906b59675ce807d3be35924a1b4338976061e0f (diff) | |
parent | 1fdfc379b6230b7d3dac4f22c846c45e93cd596d (diff) | |
download | redot-engine-54d89f2274328cbf0fd63ad01c0a203c9b0f5c62.tar.gz |
Merge pull request #56183 from raulsntos/fix-56180
Fix `KeyValuePairAt` memory leak
-rw-r--r-- | modules/mono/glue/collections_glue.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/mono/glue/collections_glue.cpp b/modules/mono/glue/collections_glue.cpp index e367ecb7d6..cb6680c244 100644 --- a/modules/mono/glue/collections_glue.cpp +++ b/modules/mono/glue/collections_glue.cpp @@ -237,10 +237,8 @@ int32_t godot_icall_Dictionary_KeyValuePairs(Dictionary *ptr, Array **keys, Arra } void godot_icall_Dictionary_KeyValuePairAt(Dictionary *ptr, int index, MonoObject **key, MonoObject **value) { - Array *keys = godot_icall_Dictionary_Keys(ptr); - Array *values = godot_icall_Dictionary_Values(ptr); - *key = GDMonoMarshal::variant_to_mono_object(keys->get(index)); - *value = GDMonoMarshal::variant_to_mono_object(values->get(index)); + *key = GDMonoMarshal::variant_to_mono_object(ptr->get_key_at_index(index)); + *value = GDMonoMarshal::variant_to_mono_object(ptr->get_value_at_index(index)); } void godot_icall_Dictionary_Add(Dictionary *ptr, MonoObject *key, MonoObject *value) { |