eina_csharp: fix memory leak in Eina.Hash.Set method

Reviewed-by: Lauro Neto <Lauro Moura <lauromoura@expertisesolutions.com.br>>
Differential Revision: https://phab.enlightenment.org/D8236
This commit is contained in:
Vitor Sousa 2019-03-07 16:58:26 +00:00 committed by Cedric BAIL
parent afc2974738
commit 4a306ec39b
1 changed files with 2 additions and 0 deletions

View File

@ -415,6 +415,8 @@ public class Hash<TKey, TValue> : IEnumerable<KeyValuePair<TKey,TValue>>, IDi
IntPtr old = eina_hash_set(Handle, nk, nv);
FreeNativeIndirection<TKey>(gchnk, ForceRefKey<TKey>());
FreeNativeIndirection<TValue>(gchnv, false);
if (OwnValue || old != IntPtr.Zero)
NativeFree<TValue>(old);
}
public TValue this[TKey key]