From: Lauro Moura Date: Mon, 30 Sep 2019 13:38:55 +0000 (+0200) Subject: eolian-cxx: Release iterators X-Git-Tag: submit/tizen/20191001.000056~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf2d2e71d502d1cbb870f09f3712e00918246911;p=platform%2Fupstream%2Fefl.git eolian-cxx: Release iterators Summary: When the iterators advanced, the CXX wrappers null'd them but did not call eina_value_free. ref T8280 Reviewers: q66, brunobelo, felipealmeida Reviewed By: q66 Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8280 Differential Revision: https://phab.enlightenment.org/D10238 --- diff --git a/src/bindings/cxx/eina_cxx/eina_iterator.hh b/src/bindings/cxx/eina_cxx/eina_iterator.hh index 6fd9095..1a8fedd 100644 --- a/src/bindings/cxx/eina_cxx/eina_iterator.hh +++ b/src/bindings/cxx/eina_cxx/eina_iterator.hh @@ -189,7 +189,10 @@ public: void* data; Eina_Bool r = ::eina_iterator_next(this->_iterator, &data); if(!r) - this->_iterator = 0; + { + ::eina_iterator_free(this->_iterator); + this->_iterator = 0; + } _value = static_cast(data); return *this; } @@ -267,7 +270,10 @@ public: void* data; Eina_Bool r = ::eina_iterator_next(this->_iterator, &data); if(!r) - this->_iterator = 0; + { + ::eina_iterator_free(this->_iterator); + this->_iterator = 0; + } _value = static_cast(data); return *this; }