From f3199ba04bcb6f7dffdeb8b79d22f819dfe0fcd7 Mon Sep 17 00:00:00 2001 From: Lauro Moura Date: Mon, 30 Sep 2019 15:38:55 +0200 Subject: [PATCH] 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 --- src/bindings/cxx/eina_cxx/eina_iterator.hh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bindings/cxx/eina_cxx/eina_iterator.hh b/src/bindings/cxx/eina_cxx/eina_iterator.hh index 6fd90958f2..1a8fedd73f 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; }