Eolian: Free Type.name stringshare after use, fix some iterators

This commit is contained in:
Kai Huuhko 2014-09-16 17:46:53 +03:00
parent eba1a05bca
commit abbf6eceaa
1 changed files with 11 additions and 6 deletions

View File

@ -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