From 74989a9531f8c8484385f7e08d7bdb29c97d84fa Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 23 Dec 2016 11:16:58 +0900 Subject: ibar - protect against getting invalid icon ptr on obj deletion remove the "ibar_icon" data completely on deletion of an object pointing to it so if it is accessed later during deletion it'll return NULL safely. --- src/modules/ibar/e_mod_main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/modules/ibar') diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index 97c040c593..2a33eefd68 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -1095,6 +1095,7 @@ _ibar_cb_icon_menu_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, v Evas_Event_Mouse_Up *ev = event_info; ic = evas_object_data_get(obj, "ibar_icon"); + if (!ic) return; if (ev->button == 3) { e_int_client_menu_show(ec, ev->canvas.x, ev->canvas.y, 0, ev->timestamp); @@ -1236,7 +1237,9 @@ _ibar_cb_icon_menu_img_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, vo ic = evas_object_data_del(obj, "ibar_icon"); if (!ic) return; //menu is closing + evas_object_data_del(obj, "ibar_icon"); ic->client_objs = eina_list_remove(ic->client_objs, obj); + if (!ic->menu) return; //who knows edje_object_part_box_remove(ic->menu->o_bg, "e.box", data); ec = evas_object_data_get(obj, "E_Client"); @@ -1281,7 +1284,11 @@ _ibar_cb_icon_frame_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void { IBar_Icon *ic = evas_object_data_del(obj, "ibar_icon"); - if (ic) ic->client_objs = eina_list_remove(ic->client_objs, obj); + if (ic) + { + evas_object_data_del(obj, "ibar_icon"); + ic->client_objs = eina_list_remove(ic->client_objs, obj); + } e_comp_object_signal_callback_del_full(data, "e,state,*focused", "e", _ibar_cb_icon_menu_focus_change, obj); evas_object_smart_callback_del_full(data, "desk_change", _ibar_cb_icon_menu_desk_change, obj); } -- cgit v1.2.1