efl_access: add free functions to efl_acces_object types

there are owned types in eolian, therefore a free function should be
defined on the types that are owned.

Reviewed-by: Lukasz Stanislawski <l.stanislaws@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7711
This commit is contained in:
Marcel Hollerbach 2019-01-14 20:43:21 +01:00
parent 256367384a
commit 062bc5f25c
4 changed files with 18 additions and 6 deletions

View File

@ -383,14 +383,20 @@ _efl_access_object_relations_get(const Eo *obj EINA_UNUSED, Efl_Access_Object_Da
return eina_list_iterator_new(pd->relations);
}
EAPI void
efl_access_attribute_free(Efl_Access_Attribute *attr)
{
eina_stringshare_del(attr->key);
eina_stringshare_del(attr->value);
free(attr);
}
EAPI void efl_access_attributes_list_free(Eina_List *list)
{
Efl_Access_Attribute *attr;
EINA_LIST_FREE(list, attr)
{
eina_stringshare_del(attr->key);
eina_stringshare_del(attr->value);
free(attr);
efl_access_attribute_free(attr);
}
}
@ -443,7 +449,7 @@ _efl_access_object_event_handler_add(Eo *class EINA_UNUSED, void *pd EINA_UNUSED
return ret;
}
EOLIAN void
EOLIAN void
_efl_access_object_event_handler_del(Eo *class EINA_UNUSED, void *pd EINA_UNUSED, Efl_Access_Event_Handler *handler)
{
Eina_List *l, *l2;

View File

@ -225,7 +225,7 @@ struct Efl.Access.Event.Children_Changed.Data
child: Efl.Object; [[Child object]]
}
struct Efl.Access.Attribute
struct @free(efl_access_attribute_free) Efl.Access.Attribute
{
[[Accessibility Attribute]]
key: string; [[Attribute key]]

View File

@ -30,6 +30,12 @@
*/
EAPI void efl_access_attributes_list_free(Eina_List *list);
/**
* Free the Efl_Access_Attribute type
*/
EAPI void
efl_access_attribute_free(Efl_Access_Attribute *attr);
#ifdef EFL_EO_API_SUPPORT
/**

View File

@ -20,7 +20,7 @@ enum Efl.Access.Text_Clip_Type
both [[Both clip types]]
}
struct Efl.Access.Text_Attribute
struct @free(elm_atspi_text_text_attribute_free) Efl.Access.Text_Attribute
{
[[Text attribute]]
name: string; [[Text attribute name]]