aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-03-20 13:18:50 -0400
committerCedric Bail <cedric@osg.samsung.com>2018-03-20 17:20:57 -0700
commitdb920723386d92218361cc68f92213975e595b3b (patch)
tree311f21b517824bace0d3dad25d04845f9ab3b30c
parentefl_ui_win: match return value to function type in elm_win_window_id_get (diff)
downloadefl-db920723386d92218361cc68f92213975e595b3b.tar.gz
edje: implement invalidate method and unset device callbacks here
prevent crashing in dangling callbacks ref d26124a6d818f62d892e178d92098f5159a8c9e0 Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
-rw-r--r--src/lib/edje/edje_load.c26
-rw-r--r--src/lib/edje/edje_private.h1
-rw-r--r--src/lib/edje/edje_smart.c6
-rw-r--r--src/lib/edje/efl_canvas_layout.eo1
4 files changed, 25 insertions, 9 deletions
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 609b60213c..bbc8ac2a50 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -1851,6 +1851,22 @@ _edje_object_collect(Edje *ed)
}
void
+_edje_file_callbacks_del(Edje *ed, Evas *e)
+{
+ Evas *tev = e;
+
+ if (!tev) tev = evas_object_evas_get(ed->obj);
+ efl_event_callback_del(tev, EFL_EVENT_DEL, _edje_device_canvas_del, ed);
+ efl_event_callback_del(tev, EFL_CANVAS_EVENT_DEVICE_ADDED,
+ _edje_device_added_cb, ed);
+ efl_event_callback_del(tev, EFL_CANVAS_EVENT_DEVICE_REMOVED,
+ _edje_device_removed_cb, ed);
+ if (ed->collection && ed->collection->use_custom_seat_names)
+ efl_event_callback_del(tev, EFL_CANVAS_EVENT_DEVICE_CHANGED,
+ _edje_device_changed_cb, ed);
+}
+
+void
_edje_file_del(Edje *ed)
{
Edje_User_Defined *eud;
@@ -1863,15 +1879,7 @@ _edje_file_del(Edje *ed)
if (tev)
{
- efl_event_callback_del(tev, EFL_EVENT_DEL, _edje_device_canvas_del, ed);
- efl_event_callback_del(tev, EFL_CANVAS_EVENT_DEVICE_ADDED,
- _edje_device_added_cb, ed);
- efl_event_callback_del(tev, EFL_CANVAS_EVENT_DEVICE_REMOVED,
- _edje_device_removed_cb, ed);
- if (ed->collection && ed->collection->use_custom_seat_names)
- efl_event_callback_del(tev, EFL_CANVAS_EVENT_DEVICE_CHANGED,
- _edje_device_changed_cb, ed);
-
+ _edje_file_callbacks_del(ed, tev);
evas_event_freeze(tev);
}
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 0261581f04..b1d2345e37 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -2497,6 +2497,7 @@ EAPI void _edje_edd_shutdown(void);
int _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const char *group, const char *parent, Eina_List *group_path, Eina_Array *nested);
+void _edje_file_callbacks_del(Edje *ed, Evas *e);
void _edje_file_del(Edje *ed);
void _edje_file_free(Edje_File *edf);
void _edje_file_cache_shutdown(void);
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index 6b4ed89256..fa5efe1070 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -48,6 +48,12 @@ _efl_canvas_layout_efl_object_constructor(Eo *obj, Edje *ed)
}
EOLIAN static void
+_efl_canvas_layout_efl_object_invalidate(Eo *obj EINA_UNUSED, Edje *ed)
+{
+ _edje_file_callbacks_del(ed, NULL);
+}
+
+EOLIAN static void
_efl_canvas_layout_efl_object_debug_name_override(Eo *obj, Edje *ed, Eina_Strbuf *sb)
{
efl_debug_name_override(efl_super(obj, MY_CLASS), sb);
diff --git a/src/lib/edje/efl_canvas_layout.eo b/src/lib/edje/efl_canvas_layout.eo
index 3d86cbb958..5bae789666 100644
--- a/src/lib/edje/efl_canvas_layout.eo
+++ b/src/lib/edje/efl_canvas_layout.eo
@@ -84,6 +84,7 @@ class Efl.Canvas.Layout (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part,
Efl.Gfx.position { set; }
Efl.Gfx.size { set; }
Efl.Object.constructor;
+ Efl.Object.invalidate;
Efl.Object.debug_name_override;
Efl.Canvas.Object.no_render { set; }
Efl.Canvas.Object.paragraph_direction { set; }