segment_control: fix variable affectation

Summary:
When an Elm_Segment_Control object is created, the constructor calls
the smart_add() behind the scenes. It then calls _update_list() which
calls _position_items(), with the sd->obj unset (because it was set
after calling super constructors). This led to a CRI() (and therefore
to a backtrace) on the creation of each Elm_Segment_Control.

@fix

Test Plan: elementary_test

Reviewers: stefan_schmidt, cedric, raster

Differential Revision: https://phab.enlightenment.org/D3276

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Jean Guyomarc'h 2015-11-09 16:13:13 -08:00 committed by Cedric BAIL
parent d0497272d1
commit cd6ddbdb3f
1 changed files with 3 additions and 3 deletions

View File

@ -605,8 +605,9 @@ _elm_segment_control_item_eo_base_constructor(Eo *obj, Elm_Segment_Control_Item_
}
EOLIAN static void
_elm_segment_control_evas_object_smart_add(Eo *obj, Elm_Segment_Control_Data *_pd EINA_UNUSED)
_elm_segment_control_evas_object_smart_add(Eo *obj, Elm_Segment_Control_Data *sd)
{
sd->obj = obj;
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
elm_widget_sub_object_parent_add(obj);
@ -698,10 +699,9 @@ elm_segment_control_add(Evas_Object *parent)
}
EOLIAN static Eo *
_elm_segment_control_eo_base_constructor(Eo *obj, Elm_Segment_Control_Data *sd)
_elm_segment_control_eo_base_constructor(Eo *obj, Elm_Segment_Control_Data *sd EINA_UNUSED)
{
obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
sd->obj = obj;
eo_do(obj,
evas_obj_type_set(MY_CLASS_NAME_LEGACY),