From 6bace96662ea233e3ce59a0099d4ccfb9d646f90 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 17 Sep 2006 00:13:52 +0000 Subject: [PATCH] Tweak the E_App object reference counting. I think this is correct, but I suspect the dir scanning in e_apps.c still needs an unref. SVN revision: 25900 --- src/bin/e_apps.c | 5 ++++- src/bin/e_border.c | 2 +- src/bin/e_fm.c | 10 ++++++++-- src/modules/ibar/e_mod_main.c | 5 ++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/bin/e_apps.c b/src/bin/e_apps.c index 73c99e6a9..f6745851d 100644 --- a/src/bin/e_apps.c +++ b/src/bin/e_apps.c @@ -220,7 +220,7 @@ e_app_new(const char *path, int scan_subdirs) { if(st.st_mtime > a->mtime) { - e_object_del(E_OBJECT(a)); + e_object_free(E_OBJECT(a)); a = NULL; stated = 1; } @@ -278,6 +278,9 @@ e_app_new(const char *path, int scan_subdirs) _e_apps_list = evas_list_prepend(_e_apps_list, a); #endif } + else + e_object_ref(E_OBJECT(a)); + return a; error: diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 4e35faf7f..292589f71 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -2552,7 +2552,7 @@ e_border_icon_add(E_Border *bd, Evas *evas) if (o) evas_object_del(o); o = e_app_icon_add(evas, a); bd->app = a; - e_object_ref(E_OBJECT(bd->app)); +// e_object_ref(E_OBJECT(bd->app)); } else { diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index de4d63ece..050db2961 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -1611,7 +1611,10 @@ _e_fm2_icon_icon_set(E_Fm2_Icon *ic) app = e_app_new(buf, 0); if (app) { - ic->obj_icon = e_app_icon_add(evas_object_evas_get(ic->sd->obj), app); +/* FIXME: Actually, I think it's the icon searching that is slowing things down a lot. + * That will be fixed by moving it to thumbnailing as planned. Commented out for now. + */ +// ic->obj_icon = e_app_icon_add(evas_object_evas_get(ic->sd->obj), app); e_object_unref(E_OBJECT(app)); } } @@ -1698,7 +1701,10 @@ _e_fm2_icon_icon_set(E_Fm2_Icon *ic) app = e_app_new(buf, 0); if (app) { - ic->obj_icon = e_app_icon_add(evas_object_evas_get(ic->sd->obj), app); +/* FIXME: Actually, I think it's the icon searching that is slowing things down a lot. + * That will be fixed by moving it to thumbnailing as planned. Commented out for now. + */ +// ic->obj_icon = e_app_icon_add(evas_object_evas_get(ic->sd->obj), app); e_object_unref(E_OBJECT(app)); } edje_object_part_swallow(ic->obj, "e.swallow.icon", ic->obj_icon); diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index 2109f8b4c..1909317a9 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -842,7 +842,10 @@ _ibar_cb_menu_add_application_cb(void *data, const char *path) b = data; a = e_app_new(path, 0); if (a) - e_app_list_append(a, b->apps); + { + e_app_list_append(a, b->apps); + e_object_unref(E_OBJECT(a)); + } _ibar_empty_handle(b); _ibar_resize_handle(b); _gc_orient(b->inst->gcc);