Fix `KeyValuePairAt` memory leak

(cherry picked from commit 1fdfc379b6)
This commit is contained in:
Raul Santos 2021-12-23 03:13:31 +01:00 committed by Rémi Verschelde
parent 6b0b5d2093
commit b096c4b05f
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 4 deletions

View File

@ -236,10 +236,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) {