summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-06-22 10:53:37 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-06-22 10:53:37 +0900
commitf067bc6f7185fa29bf55266ec8a4361cc8262173 (patch)
tree0a6142966690fa55a618b0fb8b9aa68657978abb
parentb09c1f8093eaedb723db65547f3cb1163ffbf6f5 (diff)
downloadefl-f067bc6f7185fa29bf55266ec8a4361cc8262173.tar.gz
evas: Fix crash in Efl.Ui.Box
This goes back to a stupid comment I made in 93fad2a19f2507a: No idea why evas_box was overwriting smart_data.get (esp. since it was returning a private struct). Well, it turns out the struct is NOT private and the smart data pointer can be used by any user of evas box (including Efl.Ui.Box). Fixes T3926
-rw-r--r--src/lib/evas/canvas/evas_object_box.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/evas/canvas/evas_object_box.c b/src/lib/evas/canvas/evas_object_box.c
index 63b6ca4f73..b59b347669 100644
--- a/src/lib/evas/canvas/evas_object_box.c
+++ b/src/lib/evas/canvas/evas_object_box.c
@@ -378,12 +378,14 @@ _evas_box_internal_remove_at(Eo *o, Evas_Object_Box_Data *priv, unsigned int pos
}
EOLIAN static void
-_evas_box_efl_canvas_group_group_add(Eo *o, Evas_Object_Box_Data *priv)
+_evas_box_efl_canvas_group_group_add(Eo *eo_obj, Evas_Object_Box_Data *priv)
{
- efl_canvas_group_add(eo_super(o, MY_CLASS));
+ Evas_Object_Smart_Clipped_Data *cso;
+
+ efl_canvas_group_add(eo_super(eo_obj, MY_CLASS));
evas_object_event_callback_add
- (o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_hints_changed, o);
+ (eo_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_hints_changed, eo_obj);
priv->children = NULL;
priv->align.h = 0.5;
priv->align.v = 0.5;
@@ -392,6 +394,12 @@ _evas_box_efl_canvas_group_group_add(Eo *o, Evas_Object_Box_Data *priv)
priv->layout.cb = evas_object_box_layout_horizontal;
priv->layout.data = NULL;
priv->layout.free_data = NULL;
+
+ // make sure evas box smart data is fully initialized and set (for legacy)
+ // this assumes only box and smart clipped access the smart data
+ cso = eo_data_scope_get(eo_obj, EFL_CANVAS_GROUP_CLIPPED_CLASS);
+ priv->base = *cso;
+ evas_object_smart_data_set(eo_obj, priv);
}
EOLIAN static void