eo: make more freefuncs implicit
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Fri, 22 Sep 2017 14:08:56 +0000 (16:08 +0200)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Fri, 22 Sep 2017 14:17:19 +0000 (16:17 +0200)
src/lib/ecore/efl_io_copier.eo
src/lib/efl/interfaces/efl_config.eo
src/lib/efl/interfaces/efl_io_buffer.eo
src/lib/elementary/elm_interface_atspi_accessible.eo
src/lib/eo/eina_types.eot
src/lib/eolian/database_validate.c
src/lib/evas/canvas/evas_canvas.eo

index 5096c1d..f1d254d 100644 (file)
@@ -310,7 +310,7 @@ class Efl.Io.Copier (Efl.Loop_User, Efl.Io.Closer) {
              this case you should wait for "done", "data" or "line"
              events and then call it to retrieve (and own!) the data.
            ]]
-           return: free(ptr(Eina.Binbuf), eina_binbuf_free) @owned @warn_unused; [[Binbuf]]
+           return: ptr(Eina.Binbuf) @owned @warn_unused; [[Binbuf]]
         }
 
         @property pending_size {
index e6c64b6..3f128cd 100644 (file)
@@ -17,7 +17,7 @@ interface Efl.Config ()
          params {
             name: string; [[Configuration option name]]
          }
-         return: free(ptr(generic_value), eina_value_free) @owned; [[Configuration option value]]
+         return: ptr(generic_value) @owned; [[Configuration option value]]
       }
       config_list_get @const {
          [[Returns a list of generic values under a given key.]]
index 9c51ff6..d9d4d91 100644 (file)
@@ -132,7 +132,7 @@ class Efl.Io.Buffer (Efl.Object, Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Ef
               On failure, for example a read-only backing store was
               adopted with @.adopt_readonly, NULL is returned.
             ]]
-            return: free(ptr(Eina.Binbuf), eina_binbuf_free) @owned @warn_unused; [[Binbuf]]
+            return: ptr(Eina.Binbuf) @owned @warn_unused; [[Binbuf]]
         }
     }
 
index c8cea42..9064d5d 100644 (file)
@@ -298,7 +298,8 @@ mixin Elm.Interface.Atspi_Accessible (Efl.Interface, Efl.Object)
          get {
          }
          values {
-            attributes: free(list<ptr(Elm.Atspi.Attribute) @owned>, elm_atspi_attributes_list_free) @owned; [[List of object attributes]]
+            /* FIXME: API for attribute free */
+            attributes: list<ptr(Elm.Atspi.Attribute) @owned> @owned; [[List of object attributes]]
          }
       }
       @property index_in_parent @protected {
index d483fe8..41b8921 100644 (file)
@@ -1,5 +1,5 @@
 /* FIXME: Move to Eina when we decide they are handled properly. */
-struct @extern Eina.Rect {
+struct @extern @free(eina_rectangle_free) Eina.Rect {
     [[A rectangle in pixel dimensions.]]
     x: int; [[X coordinate of the rectangle, from the top-left corner.]]
     y: int; [[Y coordinate of the rectangle, from the top-left corner.]]
index 11ba527..b2df691 100644 (file)
@@ -142,13 +142,14 @@ static const char * const eo_complex_frees[] =
 static const char *eo_obj_free = "efl_del";
 static const char *eo_str_free = "free";
 static const char *eo_strshare_free = "eina_stringshare_del";
+static const char *eo_value_free = "eina_value_free";
 
 static Eina_Bool
 _validate_type(Eolian_Type *tp)
 {
    char buf[256];
 
-   if ((tp->owned || tp->freefunc) && !database_type_is_ownable(tp, EINA_FALSE))
+   if (tp->owned && !database_type_is_ownable(tp, EINA_FALSE))
      {
         snprintf(buf, sizeof(buf), "type '%s' is not ownable", tp->full_name);
         return _type_error(tp, buf);
@@ -184,6 +185,9 @@ _validate_type(Eolian_Type *tp)
                      case KW_stringshare:
                        tp->freefunc = eina_stringshare_add(eo_strshare_free);
                        break;
+                     case KW_generic_value:
+                       tp->freefunc = eina_stringshare_add(eo_value_free);
+                       break;
                      default:
                        break;
                     }
index 65a5a22..b43c3ba 100644 (file)
@@ -571,8 +571,7 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
 
            @since 1.15
          ]]
-         return: free(list<ptr(Eina.Rect)>, evas_render_updates_free)
-            @owned @warn_unused; [[
+         return: list<ptr(Eina.Rect)> @owned @warn_unused; [[
             A newly allocated list of updated rectangles of the canvas
             ($Eina.Rect structs). Free this list with
             \@ref evas_render_updates_free.
@@ -866,8 +865,7 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
 
          See the full @ref Example_Evas_Events "example".
          */
-         return: free(list<ptr(Eina.Rect)>, evas_render_updates_free)
-            @owned @warn_unused; [[
+         return: list<ptr(Eina.Rect)> @owned @warn_unused; [[
             A newly allocated list of updated rectangles of the canvas
             ($Eina.Rect structs). Free this list with
             \@ref evas_render_updates_free.