Eolian: Warn if iterator is NULL, set it to NULL after free

This commit is contained in:
Kai Huuhko 2014-09-16 13:53:54 +03:00
parent 4073498434
commit 9acfcf842e
1 changed files with 4 additions and 0 deletions

View File

@ -148,10 +148,14 @@ cdef class EinaIterator(object):
bint itr_ret
if self.itr is NULL:
EINA_LOG_DOM_WARN(
EOLIAN_DOM, "Iterator is NULL!", NULL
)
raise StopIteration
itr_ret = eina_iterator_next(self.itr, &data)
if not itr_ret:
eina_iterator_free(self.itr)
self.itr = NULL
raise StopIteration
return void_ptr_to_python_obj(data, self.cls)