From 239e38f1739b87ed4882246d8793d8b6c04d0b55 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Sun, 18 Nov 2018 15:00:55 +0200 Subject: [PATCH] Player: reset evas pointer inside list on deletion --- src/bin/player.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bin/player.c b/src/bin/player.c index 19d7578..ccff00b 100644 --- a/src/bin/player.c +++ b/src/bin/player.c @@ -569,6 +569,7 @@ _stabilization_timer_cb(void *data EINA_UNUSED) _printf(2, "Not stable yet!\n"); EINA_LIST_FOREACH(_evas_list, itr, e) { + if (!e) continue; Exactness_Image *last_img = efl_key_data_get(e, "_last_stab_shot"); Exactness_Image *cur_img = _snapshot_shot_get(e); if (!last_img || exactness_image_compare(last_img, cur_img, NULL)) need_more = STAB_MAX; @@ -962,6 +963,13 @@ _old_shots_rm_cb(const char *name, const char *path, void *data) } } +static void +_evas_del_cb(void *data EINA_UNUSED, const Efl_Event *event) +{ + Eina_List *p = eina_list_data_find_list(_evas_list, event->object); + eina_list_data_set(p, NULL); +} + static Evas * _my_evas_new(int w EINA_UNUSED, int h EINA_UNUSED) { @@ -972,6 +980,7 @@ _my_evas_new(int w EINA_UNUSED, int h EINA_UNUSED) { _printf(1, "New Evas\n"); _evas_list = eina_list_append(_evas_list, e); + efl_event_callback_add(e, EFL_EVENT_DEL, _evas_del_cb, NULL); efl_event_callback_add(e, EFL_CANVAS_SCENE_EVENT_RENDER_POST, _evas_render_post_cb, NULL); } return e;