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
This commit is contained in:
Daniel Zaoui 2015-08-08 00:13:55 +03:00
parent 29b515cd0f
commit 409361142d
1 changed files with 13 additions and 0 deletions

View File

@ -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();