summaryrefslogtreecommitdiff
path: root/src/bindings
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-08-05 19:06:11 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-08-05 19:15:35 -0300
commitc1b76d3008ecb7c558ad4ad8de02f1e03ffddf68 (patch)
tree631410fd51486827d2fb36954fd03f34ce4e687c /src/bindings
parente6a52ef371430c69da7ce3e7b22f1455a64f1637 (diff)
csharp: fix ownership of value types in arrays and lists
Summary: `eolian_mono` now considers the implicit ownership of value types in arrays and lists when generating ownership flags. Also, update manual bindings for arrays and lists to no longer free elements in the `Dispose` method when the container has ownership of the elements but C# itself does not have ownership of the container; the elements will be freed by whoever owns the container. Modifying and removing elements will still free them though. Re-enabled unit tests that required ownership of value type elements. Reviewers: felipealmeida, q66, vitor.sousa Reviewed By: felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9457
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/mono/eina_mono/eina_array.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_list.cs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/bindings/mono/eina_mono/eina_array.cs b/src/bindings/mono/eina_mono/eina_array.cs
index e75ca6ae7a..8c09557098 100644
--- a/src/bindings/mono/eina_mono/eina_array.cs
+++ b/src/bindings/mono/eina_mono/eina_array.cs
@@ -138,7 +138,7 @@ public class Array<T> : IEnumerable<T>, IDisposable
138 return; 138 return;
139 } 139 }
140 140
141 if (OwnContent) 141 if (Own && OwnContent)
142 { 142 {
143 int len = (int)eina_array_count_custom_export_mono(h); 143 int len = (int)eina_array_count_custom_export_mono(h);
144 for (int i = 0; i < len; ++i) 144 for (int i = 0; i < len; ++i)
diff --git a/src/bindings/mono/eina_mono/eina_list.cs b/src/bindings/mono/eina_mono/eina_list.cs
index 4c25c25e62..9fe5e90d77 100644
--- a/src/bindings/mono/eina_mono/eina_list.cs
+++ b/src/bindings/mono/eina_mono/eina_list.cs
@@ -182,7 +182,7 @@ public class List<T> : IEnumerable<T>, IDisposable
182 return; 182 return;
183 } 183 }
184 184
185 if (OwnContent) 185 if (Own && OwnContent)
186 { 186 {
187 for (IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr)) 187 for (IntPtr curr = h; curr != IntPtr.Zero; curr = InternalNext(curr))
188 { 188 {