From 77594460247b8069ac701f0002162e20a30ead67 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Sat, 5 Jun 2021 00:00:29 +0900 Subject: [PATCH] canvas vg: fix a crash issue. 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/evas/canvas/efl_canvas_vg_node.c b/src/lib/evas/canvas/efl_canvas_vg_node.c index 76a6fed..7b2ca35 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_node.c +++ b/src/lib/evas/canvas/efl_canvas_vg_node.c @@ -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); -- 2.7.4