bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=062bc5f25c3f4cf2d0e43da9c980659d45652528

commit 062bc5f25c3f4cf2d0e43da9c980659d45652528
Author: Marcel Hollerbach <[email protected]>
Date:   Mon Jan 14 20:43:21 2019 +0100

    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 <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D7711
---
 src/lib/elementary/efl_access_object.c  | 14 ++++++++++----
 src/lib/elementary/efl_access_object.eo |  2 +-
 src/lib/elementary/efl_access_object.h  |  6 ++++++
 src/lib/elementary/efl_access_text.eo   |  2 +-
 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]]

-- 


Reply via email to