From abbf6eceaa5127e14b512aedc8fb7b05a54e665a Mon Sep 17 00:00:00 2001 From: Kai Huuhko Date: Tue, 16 Sep 2014 17:46:53 +0300 Subject: [PATCH] Eolian: Free Type.name stringshare after use, fix some iterators --- efl/eolian/__init__.pyx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/efl/eolian/__init__.pyx b/efl/eolian/__init__.pyx index a0e20a5..e3cd7c9 100644 --- a/efl/eolian/__init__.pyx +++ b/efl/eolian/__init__.pyx @@ -3,7 +3,8 @@ from libc.stdint cimport uintptr_t from cpython cimport PyUnicode_AsUTF8String from efl.eina cimport eina_inlist_count, EINA_LOG_DOM_DBG, \ EINA_LOG_DOM_INFO, EINA_LOG_DOM_WARN, EINA_LOG_DOM_ERR, \ - EINA_LOG_DOM_CRIT, eina_iterator_next, eina_iterator_free + EINA_LOG_DOM_CRIT, eina_iterator_next, eina_iterator_free, \ + eina_stringshare_del from efl.utils.conversions cimport _ctouni from efl.utils.logger cimport add_logger @@ -1036,22 +1037,22 @@ cdef class Function(object): property property_keys: """Returns an iterator to the keys params of a given function. - :type: list of :class:`FunctionParameter` + :type: iterator of :class:`FunctionParameter` """ def __get__(self): - cdef EinaIterator ret = EinaIterator(unicode) + cdef EinaIterator ret = EinaIterator(FunctionParameter) ret._set_obj(eolian_property_keys_get(self.function_id)) return ret property property_values: """Returns an iterator to the values params of a given function. - :type: list of :class:`FunctionParameter` + :type: iterator of :class:`FunctionParameter` """ def __get__(self): - cdef EinaIterator ret = EinaIterator(unicode) + cdef EinaIterator ret = EinaIterator(FunctionParameter) ret._set_obj(eolian_property_values_get(self.function_id)) return ret @@ -1662,7 +1663,11 @@ cdef class Type(object): """ def __get__(self): - return _ctouni(eolian_type_name_get(self.tp)) + cdef: + const char *ret1 = eolian_type_name_get(self.tp) + unicode ret2 = _ctouni(ret1) + eina_stringshare_del(ret1) + return ret2 property full_name: """Get the full (namespaced) name of a function. Only works on named