efl ui widget - call parent constructor before doing more init
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 21 Sep 2019 09:26:46 +0000 (10:26 +0100)
committerJongmin Lee <jm105.lee@samsung.com>
Sun, 22 Sep 2019 21:11:58 +0000 (06:11 +0900)
the object is not properly set up yet for child classes -0 parent like
the main evas object or smart obj havent been constructed yet so call
this really early, not in the middle of construction of an efl ui
widget...

this fixes a segv in elementary_test -to filp where it segv's on
object construction where evas object ->cur/prev are NULL (not set up
yet).

src/lib/elementary/efl_ui_widget.c

index 1dd99f6..22af83e 100644 (file)
@@ -5617,6 +5617,8 @@ _focus_event_changed(void *data EINA_UNUSED, const Efl_Event *event)
 EOLIAN static Eo *
 _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
 {
+   efl_canvas_group_clipped_set(obj, EINA_FALSE);
+   obj = efl_constructor(efl_super(obj, MY_CLASS));
    sd->on_create = EINA_TRUE;
 
    sd->window = efl_provider_find(efl_parent_get(obj), EFL_UI_WIN_CLASS);
@@ -5642,8 +5644,6 @@ _efl_ui_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UN
      }
 
    _efl_ui_focus_event_redirector(obj, obj);
-   efl_canvas_group_clipped_set(obj, EINA_FALSE);
-   obj = efl_constructor(efl_super(obj, MY_CLASS));
    efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
    evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);