evas_box: add safety check for adding box children to multiple boxes

this is guaranteed to cause a crash or equally bad behavior, so ensure an
error is raised

@fix
This commit is contained in:
Mike Blumenkrantz 2017-06-23 17:43:57 -04:00
parent b4057ef6cc
commit 920c3a5d5e
1 changed files with 5 additions and 0 deletions

View File

@ -190,6 +190,11 @@ EOLIAN static Evas_Object_Box_Option *
_evas_box_internal_option_new(Eo *o EINA_UNUSED, Evas_Object_Box_Data *_pd EINA_UNUSED, Evas_Object *child)
{
Evas_Object_Box_Option *opt;
Evas_Object *parent;
parent = evas_object_smart_parent_get(child);
if (parent && efl_isa(parent, MY_CLASS))
CRI("Adding object to box which currently belongs to different box");
opt = (Evas_Object_Box_Option *)malloc(sizeof(*opt));
if (!opt)