jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c9322dd56104e6ee23c6840fbb5a202c3218c1e1
commit c9322dd56104e6ee23c6840fbb5a202c3218c1e1 Author: Jean-Philippe Andre <jp.an...@samsung.com> Date: Tue Nov 28 16:26:25 2017 +0900 cxx: Add global _delete() method to all objects This is really just calling efl_del() and detaching the internal pointer from the C++ object. This will not affect other references, which means after del the object may still be alive, probably without a parent. --- src/bindings/cxx/eo_cxx/eo_concrete.hh | 7 +++++++ src/bindings/cxx/eo_cxx/eo_ops.hh | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/bindings/cxx/eo_cxx/eo_concrete.hh b/src/bindings/cxx/eo_cxx/eo_concrete.hh index 47013dcbc6..2b29d09545 100644 --- a/src/bindings/cxx/eo_cxx/eo_concrete.hh +++ b/src/bindings/cxx/eo_cxx/eo_concrete.hh @@ -167,6 +167,13 @@ struct concrete _eo_raw = _ptr; } + void _delete() + { + Eo* tmp = _eo_raw; + _eo_raw = nullptr; + detail::del(tmp); + } + explicit operator bool() const { return _eo_raw; diff --git a/src/bindings/cxx/eo_cxx/eo_ops.hh b/src/bindings/cxx/eo_cxx/eo_ops.hh index 1f08d8d738..4f9c1f79ae 100644 --- a/src/bindings/cxx/eo_cxx/eo_ops.hh +++ b/src/bindings/cxx/eo_cxx/eo_ops.hh @@ -39,6 +39,12 @@ unref(const Eo *obj) ::efl_unref(obj); } +inline void +del(Eo *obj) +{ + ::efl_del(obj); +} + inline int ref_get(const Eo *obj) { --