summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-04-13 13:50:43 +0100
committerJaehwan Kim <jae.hwan.kim@samsung.com>2015-04-14 18:09:42 +0900
commit55e96703c05fa670c2384aea3d52205ce9a195ea (patch)
tree77032a76db4aefe4046d8f897eb850d280ca1b31
parent8f22f51ccaae286e8610c0aafa0bca247d8d79bb (diff)
downloadefl-55e96703c05fa670c2384aea3d52205ce9a195ea.tar.gz
Evas object: verify the parent is valid and fail if not.
It seems like before the switch to Eo, all the object_*_add functions had magic checks that only allowed non NULL Evas pointers to be passed. Since we switched to Eo we apparently missed the early failure we used to have, and we instead fail later. This patch should fix that. Thanks to jaehwan for reporting. @fix Change-Id: Ic9d30d25b6b3120472b908ef6992b1462a3a2b3e Origin: upstream
-rw-r--r--src/lib/evas/canvas/evas_object_main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index da97914345..1b3fe4b81c 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -85,11 +85,15 @@ _init_cow(void)
EOLIAN static void
_evas_object_eo_base_constructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
{
+ Eo *parent = NULL;
+
eo_do_super(eo_obj, MY_CLASS, eo_constructor());
eo_do(eo_obj, evas_obj_type_set(MY_CLASS_NAME));
eo_manual_free_set(eo_obj, EINA_TRUE);
- if (!obj || !_init_cow())
+ eo_do(eo_obj, parent = eo_parent_get());
+
+ if (!obj || !_init_cow() || !eo_isa(parent, EVAS_COMMON_INTERFACE_INTERFACE))
{
eo_error_set(eo_obj);
return;