summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2017-06-09 16:14:18 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-07-13 18:25:44 -0300
commitd045753e783a48ca943f89463fbcb1e1279f5943 (patch)
tree3a95275de2b9dfc1a47f2d692f3ce4425143c438
parent431299c99d5a7b40e64b64e8e5ec4aed914de623 (diff)
eina_mono: always call ResidueFreeInplace to avoid memory leak
-rw-r--r--src/bindings/mono/eina_mono/eina_inarray.cs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/bindings/mono/eina_mono/eina_inarray.cs b/src/bindings/mono/eina_mono/eina_inarray.cs
index b2c55254be..26ff33136c 100644
--- a/src/bindings/mono/eina_mono/eina_inarray.cs
+++ b/src/bindings/mono/eina_mono/eina_inarray.cs
@@ -195,8 +195,7 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
195 var r = eina_inarray_push(Handle, ele); 195 var r = eina_inarray_push(Handle, ele);
196 if (r == -1) 196 if (r == -1)
197 NativeFreeInplace<T>(ele); 197 NativeFreeInplace<T>(ele);
198 else 198 ResidueFreeInplace<T>(ele);
199 ResidueFreeInplace<T>(ele);
200 return r; 199 return r;
201 } 200 }
202 201
@@ -231,10 +230,9 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
231 { 230 {
232 IntPtr ele = ManagedToNativeAllocInplace(val); 231 IntPtr ele = ManagedToNativeAllocInplace(val);
233 var r = eina_inarray_insert_at(Handle, idx, ele); 232 var r = eina_inarray_insert_at(Handle, idx, ele);
234 if (r) 233 if (!r)
235 ResidueFreeInplace<T>(ele);
236 else
237 NativeFreeInplace<T>(ele); 234 NativeFreeInplace<T>(ele);
235 ResidueFreeInplace<T>(ele);
238 return r; 236 return r;
239 } 237 }
240 238
@@ -247,10 +245,9 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
247 NativeFreeInplace<T>(ele); 245 NativeFreeInplace<T>(ele);
248 ele = ManagedToNativeAllocInplace(val); 246 ele = ManagedToNativeAllocInplace(val);
249 var r = eina_inarray_insert_at(Handle, idx, ele); 247 var r = eina_inarray_insert_at(Handle, idx, ele);
250 if (r) 248 if (!r)
251 ResidueFreeInplace<T>(ele);
252 else
253 NativeFreeInplace<T>(ele); 249 NativeFreeInplace<T>(ele);
250 ResidueFreeInplace<T>(ele);
254 return r; 251 return r;
255 } 252 }
256 253