jpeg pushed a commit to branch master.

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

commit d4b2eb1e7feb18094f293b38e5a84453d43cd84a
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Thu Jul 20 18:00:15 2017 +0900

    elm: Move calls to efl_destructor(efl_super()) to the end
    
    When destroying any object, its parent class destructor should
    be called after the subclass destructor has been called. Only
    some extremely limited work may be done after the super call.
    
    This commit makes sure that all efl_destructor() overrides in
    elementary are doing operations in the right order.
    
    Also, remove a return void.
---
 src/lib/elementary/efl_ui_focus_manager_sub.c |  2 +-
 src/lib/elementary/elm_flipselector.c         |  4 ++--
 src/lib/elementary/elm_widget.c               | 16 +++++++++-------
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/lib/elementary/efl_ui_focus_manager_sub.c 
b/src/lib/elementary/efl_ui_focus_manager_sub.c
index 02f0898a8c..c7a167892f 100644
--- a/src/lib/elementary/efl_ui_focus_manager_sub.c
+++ b/src/lib/elementary/efl_ui_focus_manager_sub.c
@@ -246,7 +246,7 @@ _efl_ui_focus_manager_sub_efl_object_destructor(Eo *obj, 
Efl_Ui_Focus_Manager_Su
 {
    _border_unregister(obj, pd);
 
-   return efl_destructor(efl_super(obj, MY_CLASS));
+   efl_destructor(efl_super(obj, MY_CLASS));
 }
 
 
diff --git a/src/lib/elementary/elm_flipselector.c 
b/src/lib/elementary/elm_flipselector.c
index e5711e0790..8864277ad3 100644
--- a/src/lib/elementary/elm_flipselector.c
+++ b/src/lib/elementary/elm_flipselector.c
@@ -287,7 +287,6 @@ _elm_flipselector_item_efl_object_destructor(Eo *eo_item, 
Elm_Flipselector_Item_
         eina_stringshare_del(item->label);
         sd->items = eina_list_remove(sd->items, eo_item);
         efl_destructor(efl_super(eo_item, ELM_FLIPSELECTOR_ITEM_CLASS));
-
         return;
      }
 
@@ -302,7 +301,6 @@ _elm_flipselector_item_efl_object_destructor(Eo *eo_item, 
Elm_Flipselector_Item_
 
    eina_stringshare_del(item->label);
    sd->items = eina_list_remove(sd->items, eo_item);
-   efl_destructor(efl_super(eo_item, ELM_FLIPSELECTOR_ITEM_CLASS));
 
    _sentinel_eval(sd);
 
@@ -311,6 +309,8 @@ _elm_flipselector_item_efl_object_destructor(Eo *eo_item, 
Elm_Flipselector_Item_
         if (sd->view_update) ecore_job_del(sd->view_update);
         sd->view_update = ecore_job_add(_view_update, WIDGET(item));
      }
+
+   efl_destructor(efl_super(eo_item, ELM_FLIPSELECTOR_ITEM_CLASS));
 }
 
 EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 8b758a940b..422bfdddf9 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -6214,15 +6214,13 @@ _elm_widget_efl_object_finalize(Eo *obj, 
Elm_Widget_Smart_Data *pd)
 
 
 EOLIAN static void
-_elm_widget_efl_object_destructor(Eo *obj, Elm_Widget_Smart_Data *sd 
EINA_UNUSED)
+_elm_widget_efl_object_destructor(Eo *obj, Elm_Widget_Smart_Data *sd)
 {
-   sd->on_destroy = EINA_TRUE;
-   efl_destructor(efl_super(obj, ELM_WIDGET_CLASS));
-   sd->on_destroy = EINA_FALSE;
-
    if (sd->manager.provider)
-     efl_event_callback_del(sd->manager.provider, 
EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj);
-   sd->manager.provider = NULL;
+     {
+        efl_event_callback_del(sd->manager.provider, 
EFL_UI_FOCUS_USER_EVENT_MANAGER_CHANGED, _manager_changed_cb, obj);
+        sd->manager.provider = NULL;
+     }
 
    elm_interface_atspi_accessible_removed(obj);
    if (sd->logical.parent)
@@ -6230,6 +6228,10 @@ _elm_widget_efl_object_destructor(Eo *obj, 
Elm_Widget_Smart_Data *sd EINA_UNUSED
         efl_weak_unref(&sd->logical.parent);
         sd->logical.parent = NULL;
      }
+
+   sd->on_destroy = EINA_TRUE;
+   efl_destructor(efl_super(obj, ELM_WIDGET_CLASS));
+   sd->on_destroy = EINA_FALSE;
 }
 
 EOLIAN static Eina_Bool

-- 


Reply via email to