From 409361142de503d6aaa24ea4473281776244bc65 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Sat, 8 Aug 2015 00:13:55 +0300 Subject: [PATCH] Delete Evas callbacks on win deletion A crash happens when a movie finishes and the program terminates. An access to the "inf" data is done, although this data has been freed during the win deletion. It crashes only if the mouse is not over the progress bar. @fix --- src/bin/win.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bin/win.c b/src/bin/win.c index 6a1e6d7..4e768e2 100644 --- a/src/bin/win.c +++ b/src/bin/win.c @@ -28,6 +28,8 @@ _cb_unfullscreen(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUS evas_object_hide(inf->event2); } +static void +_cb_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info); static void _cb_win_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *ev EINA_UNUSED) { @@ -46,6 +48,17 @@ _cb_win_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void if (vid->uri) efreet_uri_free(vid->uri); free(vid); } + evas_object_event_callback_del_full(inf->event, EVAS_CALLBACK_MOUSE_MOVE, + _cb_mouse_move, obj); + evas_object_event_callback_del_full(inf->event, EVAS_CALLBACK_MOUSE_IN, + _cb_mouse_move, obj); + evas_object_event_callback_del_full(inf->event, EVAS_CALLBACK_MOUSE_DOWN, + _cb_mouse_move, obj); + evas_object_event_callback_del_full(inf->event2, EVAS_CALLBACK_MOUSE_MOVE, + _cb_mouse_move, obj); + evas_object_event_callback_del_full(inf->event2, EVAS_CALLBACK_MOUSE_OUT, + _cb_mouse_move, obj); + evas_object_data_del(obj, "inf"); free(inf); dnd_shutdown();