Eolian: Correct stringshare handling to match updated docs

This commit is contained in:
Kai Huuhko 2014-09-22 15:40:31 +03:00
parent fe16722cbe
commit 2543fa6a17
1 changed files with 25 additions and 5 deletions

View File

@ -946,7 +946,11 @@ cdef class Function(object):
"""
if isinstance(prefix, unicode): prefix = PyUnicode_AsUTF8String(prefix)
return _ctouni(eolian_function_full_c_name_get(self.function_id, prefix))
cdef Eina_Stringshare *ret1
ret1 = eolian_function_full_c_name_get(self.function_id, prefix)
ret2 = _ctouni(ret1)
eina_stringshare_del(ret1)
return ret2
def legacy_get(self, Eolian_Function_Type f_type):
"""Returns a legacy name for a function.
@ -1645,7 +1649,11 @@ cdef class Type(object):
"""
if isinstance(name, unicode): name = PyUnicode_AsUTF8String(name)
return _ctouni(eolian_type_c_type_named_get(self.tp, name))
cdef Eina_Stringshare *ret1
ret1 = eolian_type_c_type_named_get(self.tp, name)
ret2 = _ctouni(ret1)
eina_stringshare_del(ret1)
return ret2
property c_type:
"""Get the full C type name of the given type without a name.
@ -1658,7 +1666,11 @@ cdef class Type(object):
"""
def __get__(self):
return _ctouni(eolian_type_c_type_get(self.tp))
cdef Eina_Stringshare *ret1
ret1 = eolian_type_c_type_get(self.tp)
ret2 = _ctouni(ret1)
eina_stringshare_del(ret1)
return ret2
property name:
"""Get the name of the given type. For EOLIAN_TYPE_REGULAR and
@ -1831,7 +1843,11 @@ cdef class Expression(object):
resolve namespaces and enum field names.
"""
return _ctouni(eolian_expression_serialize(self.expr))
cdef Eina_Stringshare *ret1
ret1 = eolian_expression_serialize(self.expr)
ret2 = _ctouni(ret1)
eina_stringshare_del(ret1)
return ret2
property type:
"""Get the type of an expression.
@ -1940,7 +1956,11 @@ cdef class Value(object):
yourself.
"""
return _ctouni(eolian_expression_value_to_literal(<const Eolian_Value *>&self.v))
cdef Eina_Stringshare *ret1
ret1 = eolian_expression_value_to_literal(<const Eolian_Value *>&self.v)
ret2 = _ctouni(ret1)
eina_stringshare_del(ret1)
return ret2
cdef class Variable(object):