summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-11-10 18:51:56 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-11-10 19:06:57 +0900
commit3195b760eec9ea67c988366d3230d8209bb49183 (patch)
tree9c5329c6093b5809aa91e264569529cb3786211c
parent551657e02a1165c3940a98c10f5d2019d1c6a5fe (diff)
downloadenlightenment-3195b760eec9ea67c988366d3230d8209bb49183.tar.gz
ibar - fix shutdown if ibar client menu is up
valgrind pointed out a referencing issue with the ibar client menu on hover and if e is shut down while this is up. it ends up referencing an already deleted ibar icon, so delete the menu objects that reference the icon if icon is deleted. @fix
-rw-r--r--src/modules/ibar/e_mod_main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c
index 437f8ae3b8..4980fe37ea 100644
--- a/src/modules/ibar/e_mod_main.c
+++ b/src/modules/ibar/e_mod_main.c
@@ -69,6 +69,7 @@ struct _IBar_Icon
IBar *ibar;
Evas_Object *o_holder, *o_icon;
Evas_Object *o_holder2, *o_icon2;
+ Eina_List *client_objs;
Efreet_Desktop *app;
Ecore_Timer *reset_timer;
Ecore_Timer *timer;
@@ -875,7 +876,9 @@ static void
_ibar_icon_free(IBar_Icon *ic)
{
E_Exec_Instance *inst;
+ Evas_Object *o;
+ EINA_LIST_FREE(ic->client_objs, o) evas_object_del(o);
if (ic->ibar->menu_icon == ic) ic->ibar->menu_icon = NULL;
if (ic->ibar->ic_drop_before == ic) ic->ibar->ic_drop_before = NULL;
if (ic->menu) e_object_data_set(E_OBJECT(ic->menu), NULL);
@@ -1214,9 +1217,11 @@ _ibar_cb_icon_menu_img_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, vo
{
int w, h;
E_Client *ec;
- IBar_Icon *ic = evas_object_data_del(data, "ibar_icon");
+ IBar_Icon *ic;
+ ic = evas_object_data_del(data, "ibar_icon");
if (!ic) return; //menu is closing
+ if (ic) 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");
@@ -1279,6 +1284,8 @@ _ibar_icon_menu_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA
static void
_ibar_cb_icon_frame_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
{
+ IBar_Icon *ic = evas_object_data_del(obj, "ibar_icon");
+ if (ic) 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);
}
@@ -1293,10 +1300,12 @@ _ibar_icon_menu_client_add(IBar_Icon *ic, E_Client *ec)
if (ec->netwm.state.skip_taskbar) return EINA_FALSE;
o = ic->menu->o_bg;
it = edje_object_add(e_comp->evas);
+ ic->client_objs = eina_list_append(ic->client_objs, it);
e_comp_object_util_del_list_append(ic->menu->comp_object, it);
e_theme_edje_object_set(it, "base/theme/modules/ibar",
"e/modules/ibar/menu/item");
img = e_comp_object_util_mirror_add(ec->frame);
+ ic->client_objs = eina_list_append(ic->client_objs, img);
e_comp_object_signal_callback_add(ec->frame, "e,state,*focused", "e", _ibar_cb_icon_menu_focus_change, it);
evas_object_smart_callback_add(ec->frame, "desk_change", _ibar_cb_icon_menu_desk_change, it);
evas_object_event_callback_add(it, EVAS_CALLBACK_DEL,