summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2017-06-20 14:29:33 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-07-13 18:34:54 -0300
commit806b60056c3e3a2bf153999cad9fc6e0f102417f (patch)
treeff0214042c4db94eac76581ad670c939b0b546ea
parent5be1fdac2e581dee4b472aec12fd0fde5afa2209 (diff)
eina_mono: Fix eina.Inarray ReplaceAt method
-rw-r--r--src/bindings/mono/eina_mono/eina_inarray.cs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/bindings/mono/eina_mono/eina_inarray.cs b/src/bindings/mono/eina_mono/eina_inarray.cs
index 26ff33136c..ef3acc1d62 100644
--- a/src/bindings/mono/eina_mono/eina_inarray.cs
+++ b/src/bindings/mono/eina_mono/eina_inarray.cs
@@ -238,15 +238,13 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
238 238
239 public bool ReplaceAt(uint idx, T val) 239 public bool ReplaceAt(uint idx, T val)
240 { 240 {
241 IntPtr ele = eina_inarray_nth(Handle, idx); 241 var old = eina_inarray_nth(Handle, idx);
242 if (ele == IntPtr.Zero) 242 if (old == IntPtr.Zero)
243 return false; 243 return false;
244 if (OwnContent) 244 if (OwnContent)
245 NativeFreeInplace<T>(ele); 245 NativeFreeInplace<T>(old);
246 ele = ManagedToNativeAllocInplace(val); 246 var ele = ManagedToNativeAllocInplace(val);
247 var r = eina_inarray_insert_at(Handle, idx, ele); 247 var r = eina_inarray_replace_at(Handle, idx, ele);
248 if (!r)
249 NativeFreeInplace<T>(ele);
250 ResidueFreeInplace<T>(ele); 248 ResidueFreeInplace<T>(ele);
251 return r; 249 return r;
252 } 250 }