summaryrefslogtreecommitdiff
path: root/src/lib/eolian_cxx/grammar/klass_def.hpp
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/lib/eolian_cxx/grammar/klass_def.hpp
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 '')
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 9157cfd5b1..4d6d4ea79f 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -376,6 +376,7 @@ struct type_def
376 bool is_ptr; 376 bool is_ptr;
377 bool is_beta; 377 bool is_beta;
378 std::string doc_summary; 378 std::string doc_summary;
379 bool is_value_type;
379 380
380 type_def() = default; 381 type_def() = default;
381 type_def(variant_type original_type, std::string c_type, bool has_own, bool is_ptr, bool is_beta, std::string doc_summary) 382 type_def(variant_type original_type, std::string c_type, bool has_own, bool is_ptr, bool is_beta, std::string doc_summary)
@@ -428,6 +429,7 @@ type_def const void_ {attributes::regular_type_def{"void", {qualifier_info::is_n
428inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* unit, Eolian_C_Type_Type ctype) 429inline void type_def::set(Eolian_Type const* eolian_type, Eolian_Unit const* unit, Eolian_C_Type_Type ctype)
429{ 430{
430 c_type = ::eolian_type_c_type_get(eolian_type, ctype); 431 c_type = ::eolian_type_c_type_get(eolian_type, ctype);
432 is_value_type = ('*' != c_type.back());
431 // ::eina_stringshare_del(stringshare); // this crashes 433 // ::eina_stringshare_del(stringshare); // this crashes
432 Eolian_Type const* stp = eolian_type_base_type_get(eolian_type); 434 Eolian_Type const* stp = eolian_type_base_type_get(eolian_type);
433 has_own = !!::eolian_type_is_owned(eolian_type); 435 has_own = !!::eolian_type_is_owned(eolian_type);