summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-14 20:43:21 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-22 14:02:40 +0100
commit062bc5f25c3f4cf2d0e43da9c980659d45652528 (patch)
treeacf144f098f606b6abf1185ead104919b5671916
parent256367384ae0368084c89d4733ac7ca404b9b161 (diff)
downloadefl-062bc5f25c3f4cf2d0e43da9c980659d45652528.tar.gz
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
-rw-r--r--src/lib/elementary/efl_access_object.c14
-rw-r--r--src/lib/elementary/efl_access_object.eo2
-rw-r--r--src/lib/elementary/efl_access_object.h6
-rw-r--r--src/lib/elementary/efl_access_text.eo2
4 files changed, 18 insertions, 6 deletions
diff --git a/src/lib/elementary/efl_access_object.c b/src/lib/elementary/efl_access_object.c
index b9626274e2..d477d87077 100644
--- a/src/lib/elementary/efl_access_object.c
+++ b/src/lib/elementary/efl_access_object.c
@@ -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;
diff --git a/src/lib/elementary/efl_access_object.eo b/src/lib/elementary/efl_access_object.eo
index e20f50dc60..3ca5b04dda 100644
--- a/src/lib/elementary/efl_access_object.eo
+++ b/src/lib/elementary/efl_access_object.eo
@@ -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]]
diff --git a/src/lib/elementary/efl_access_object.h b/src/lib/elementary/efl_access_object.h
index 72fb57734e..22dc4bf9ad 100644
--- a/src/lib/elementary/efl_access_object.h
+++ b/src/lib/elementary/efl_access_object.h
@@ -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
/**
diff --git a/src/lib/elementary/efl_access_text.eo b/src/lib/elementary/efl_access_text.eo
index 7b13206937..6226af90ee 100644
--- a/src/lib/elementary/efl_access_text.eo
+++ b/src/lib/elementary/efl_access_text.eo
@@ -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]]