summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-12-13 11:52:15 +0900
committerHermet Park <hermetpark@gmail.com>2019-12-13 11:54:05 +0900
commit025dca5c77fcb55b45c9709758312883cf1fe9bb (patch)
tree5697d6eb6f6ca2bcb275d3656adaa15cd32c7c15
parenta8b1cfb6fca185537ebd42d91bc41bebd3248770 (diff)
evas vg: fix memory corruption for user entry.
Container must have a set parent after construction. efl_add_ref() with a parent won't work this case because container needs some jobs in overriding parent_set() after proper intialization.
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c
index 4b6d522..740cfac 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.c
@@ -369,7 +369,7 @@ _efl_canvas_vg_object_efl_object_constructor(Eo *eo_obj, Efl_Canvas_Vg_Object_Da
369 369
370 /* default root node */ 370 /* default root node */
371 pd->obj = obj; 371 pd->obj = obj;
372 pd->root = efl_add_ref(EFL_CANVAS_VG_CONTAINER_CLASS, eo_obj); 372 pd->root = efl_add_ref(EFL_CANVAS_VG_CONTAINER_CLASS, NULL);
373 373
374 eina_array_step_set(&pd->cleanup, sizeof(pd->cleanup), 8); 374 eina_array_step_set(&pd->cleanup, sizeof(pd->cleanup), 8);
375 375
@@ -381,6 +381,12 @@ _efl_canvas_vg_object_efl_object_finalize(Eo *obj, Efl_Canvas_Vg_Object_Data *pd
381{ 381{
382 Evas *e = evas_object_evas_get(obj); 382 Evas *e = evas_object_evas_get(obj);
383 383
384 /* Container must have a set parent after construction.
385 efl_add_ref() with a parent won't work this case
386 because container needs some jobs in overriding parent_set()
387 after proper intialization. */
388 efl_parent_set(pd->root, obj);
389
384 // TODO: If we start to have to many Evas_Object_VG per canvas, it may be nice 390 // TODO: If we start to have to many Evas_Object_VG per canvas, it may be nice
385 // to actually have one event per canvas and one array per canvas to. 391 // to actually have one event per canvas and one array per canvas to.
386 efl_event_callback_add(e, EFL_CANVAS_SCENE_EVENT_RENDER_POST, _cleanup_reference, pd); 392 efl_event_callback_add(e, EFL_CANVAS_SCENE_EVENT_RENDER_POST, _cleanup_reference, pd);