eo: efl_del should not be something anyone can override this can break so many things.
authorCedric BAIL <cedric@osg.samsung.com>
Mon, 7 May 2018 17:50:30 +0000 (10:50 -0700)
committerWonki Kim <wonki_.kim@samsung.com>
Fri, 1 Jun 2018 03:51:56 +0000 (12:51 +0900)
Allowing override of efl_del allow for messing with object life cycle which can create
problem for binding where an object was expected to be invalidated, but isn't really.

src/lib/elementary/elm_multibuttonentry.eo
src/lib/eo/Eo.h
src/lib/eo/efl_object.eo
src/lib/eo/eo_base_class.c

index f689ccf..f801df2 100644 (file)
@@ -86,7 +86,7 @@ class Elm.Multibuttonentry (Efl.Ui.Layout.Object, Efl.Ui.Clickable, Efl.Ui.Legac
       item_prepend {
          [[Prepend a new item to the multibuttonentry
 
-           See @Efl.Object.del to delete the item.]]
+           See @Efl.Object.invalidate to delete the item.]]
 
          return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]]
          params {
@@ -113,7 +113,7 @@ class Elm.Multibuttonentry (Efl.Ui.Layout.Object, Efl.Ui.Clickable, Efl.Ui.Legac
       item_insert_before {
          [[Add a new item to the multibuttonentry before the indicated object reference.
 
-           See @Efl.Object.del to delete the item.]]
+           See @Efl.Object.invalidate to delete the item.]]
 
          return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]]
          params {
@@ -126,7 +126,7 @@ class Elm.Multibuttonentry (Efl.Ui.Layout.Object, Efl.Ui.Clickable, Efl.Ui.Legac
       item_append {
          [[Append a new item to the multibuttonentry
 
-           See @Efl.Object.del to delete the item.]]
+           See @Efl.Object.invalidate to delete the item.]]
 
          return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]]
          params {
@@ -164,7 +164,7 @@ class Elm.Multibuttonentry (Efl.Ui.Layout.Object, Efl.Ui.Clickable, Efl.Ui.Legac
       item_insert_after {
          [[Add a new item to the multibuttonentry after the indicated object
 
-           See @Efl.Object.del to delete the item.]]
+           See @Efl.Object.invalidate to delete the item.]]
 
          return: Elm.Widget.Item; [[A handle to the item added or NULL if not possible]]
          params {
index c7467b1..6f85481 100644 (file)
@@ -1493,6 +1493,20 @@ EAPI Eo *_efl_added_get(void);
 EAPI Eo * _efl_add_internal_start(const char *file, int line, const Efl_Class *klass_id, Eo *parent, Eina_Bool ref, Eina_Bool is_fallback);
 
 /**
+ * @brief Unrefs the object and reparents it to NULL.
+ *
+ * Because efl_del() unrefs and reparents to NULL, it doesn't really delete the
+ * object.
+ *
+ * This method accepts a const object for convenience, so all objects can be
+ * passed to it easily.
+ * @param[in] obj The object.
+ *
+ * @ingroup Efl_Object
+ */
+EAPI void efl_del(const Eo *obj);
+
+/**
  * @brief Get a pointer to the data of an object for a specific class.
  *
  * The data reference count is not incremented. The pointer must be used only
index a9fd471..97a9489 100644 (file)
@@ -39,15 +39,6 @@ abstract Efl.Object ()
             parent: Efl.Object @nullable; [[The new parent]]
          }
       }
-      del @const {
-         [[Unrefs the object and reparents it to NULL.
-
-           Because efl_del() unrefs and reparents to NULL, it doesn't really delete the object.
-
-           This method accepts a const object for convenience, so all objects
-           can be passed to it easily.
-         ]]
-      }
       @property name {
          [[ The name of the object.
 
index 4488379..4c3c409 100644 (file)
@@ -647,9 +647,10 @@ _efl_object_debug_name_override(Eo *obj_id EINA_UNUSED, Efl_Object_Data *pd EINA
 {
 }
 
-EOLIAN static void
-_efl_object_del(const Eo *obj, Efl_Object_Data *pd EINA_UNUSED)
+EAPI void
+efl_del(const Eo *obj)
 {
+   if (!obj) return ;
    if (efl_parent_get((Eo *) obj))
      {
         efl_parent_set((Eo *) obj, NULL);