diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-12-23 11:16:58 +0900 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2016-12-23 11:16:58 +0900 |
commit | 74989a9531f8c8484385f7e08d7bdb29c97d84fa (patch) | |
tree | 5aeb3fc7037aac467223ac50e4a5396da59bbc84 /src/modules/ibar | |
parent | 8efbeb7acf9a029f4dad559ff4bedd5a586ed813 (diff) | |
download | enlightenment-74989a9531f8c8484385f7e08d7bdb29c97d84fa.tar.gz |
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.
Diffstat (limited to 'src/modules/ibar')
-rw-r--r-- | src/modules/ibar/e_mod_main.c | 9 |
1 files changed, 8 insertions, 1 deletions
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); } |