cedric pushed a commit to branch enlightenment-0.17.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=eb0d0487cf594ed8289a169d99dae5c11c0a2b2f

commit eb0d0487cf594ed8289a169d99dae5c11c0a2b2f
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Sun Mar 31 11:58:41 2013 +0900

    segv-- for clock popup o_popclock object ref benig dangling. this is a
    new bug methinks in e18 dev.
---
 src/modules/clock/e_mod_main.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/modules/clock/e_mod_main.c b/src/modules/clock/e_mod_main.c
index 3f8c590..0bd2fe8 100644
--- a/src/modules/clock/e_mod_main.c
+++ b/src/modules/clock/e_mod_main.c
@@ -291,6 +291,7 @@ _clock_settings_cb(void *d1, void *d2 __UNUSED__)
    e_int_config_clock_module(inst->popup->win->zone->container, inst->cfg);
    e_object_del(E_OBJECT(inst->popup));
    inst->popup = NULL;
+   inst->o_popclock = NULL;
 }
 
 static Eina_Bool
@@ -310,6 +311,16 @@ _clock_popup_desk_change(Instance *inst, int type 
__UNUSED__, E_Event_Desk_After
 }
 
 static void
+_popclock_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *info 
__UNUSED__)
+{
+   Instance *inst = data;
+   if (inst->o_popclock == obj)
+     {
+        inst->o_popclock = NULL;
+     }
+}
+
+static void
 _clock_popup_new(Instance *inst)
 {
    Evas *evas;
@@ -332,6 +343,8 @@ _clock_popup_new(Instance *inst)
 
    oi = edje_object_add(evas);
    inst->o_popclock = oi;
+   evas_object_event_callback_add(oi, EVAS_CALLBACK_DEL, _popclock_del_cb, 
inst);
+   
    if (inst->cfg->digital_clock)
      e_theme_edje_object_set(oi, "base/theme/modules/clock",
                              "e/modules/clock/digital");

-- 


Reply via email to