canvas vg: fix a crash issue. 54/259354/3
authorHermet Park <chuneon.park@samsung.com>
Fri, 4 Jun 2021 15:00:29 +0000 (00:00 +0900)
committerChun <jykeon@samsung.com>
Mon, 7 Jun 2021 03:00:29 +0000 (03:00 +0000)
clear the scene before its parent is changed.
this can occur the corruption of the scene tree
that brings the shapes appended to multiple scenes.

Change-Id: I9d729e185e3d5e27653ec54bda259081c67f5214

src/lib/evas/canvas/efl_canvas_vg_node.c

index 76a6fed..7b2ca35 100644 (file)
@@ -366,6 +366,7 @@ _efl_canvas_vg_node_efl_object_parent_set(Eo *obj,
    // FIXME: this may become slow with to much object
    if (old_cd)
      {
+        if (old_cd->scene) tvg_scene_clear(old_cd->scene, EINA_FALSE);
         old_cd->children = eina_list_remove(old_cd->children, obj);
         eina_hash_del(old_cd->names, efl_name_get(efl_super(obj, MY_CLASS)), obj);
         _node_change(old_parent, efl_data_scope_get(old_parent, MY_CLASS));
@@ -375,6 +376,7 @@ _efl_canvas_vg_node_efl_object_parent_set(Eo *obj,
 
    if (cd)
      {
+        if (cd->scene) tvg_scene_clear(cd->scene, EINA_FALSE);
         cd->children = eina_list_append(cd->children, obj);
         _efl_canvas_vg_node_name_insert(obj, cd);