raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=06065de1277f72b04716eb6cc08454bf056c6735

commit 06065de1277f72b04716eb6cc08454bf056c6735
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Fri May 27 12:48:14 2016 +0900

    rage - be paranoid about timers still going off after deletion
    
    it seems either the ecore timer changes or eodel/unref changes have
    caused something bad. timers even tho deleted by ecore_timer_del still
    go ticking. this seems to happen in range with the thumb objects. the
    smart del deletes the timer - explicitly then LATER the callback is
    called still. bad bad bad. for now - don't segv... but eo complaints
    about invalid obj id's are due to eo/efl changes.
    
    -> cedric
    -> tasn
    
    :S
---
 src/bin/videothumb.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/bin/videothumb.c b/src/bin/videothumb.c
index 8de04c9..0b4ee19 100644
--- a/src/bin/videothumb.c
+++ b/src/bin/videothumb.c
@@ -395,6 +395,7 @@ static void
 _smart_del(Evas_Object *obj)
 {
    Videothumb *sd = evas_object_smart_data_get(obj);
+
    if (!sd) return;
    vidthumbs = eina_list_remove(vidthumbs, obj);
    if (sd->thumb_exe)
@@ -404,10 +405,7 @@ _smart_del(Evas_Object *obj)
         ecore_exe_kill(sd->thumb_exe);
         ecore_exe_free(sd->thumb_exe);
      }
-   if (sd->launch_timer)
-     {
-        ecore_timer_del(sd->launch_timer);
-     }
+   if (sd->launch_timer) ecore_timer_del(sd->launch_timer);
    if (sd->file) eina_stringshare_del(sd->file);
    if (sd->realfile) eina_stringshare_del(sd->realfile);
    if (sd->realpath) free(sd->realpath);
@@ -415,6 +413,16 @@ _smart_del(Evas_Object *obj)
    if (sd->o_img2) evas_object_del(sd->o_img2);
    if (sd->exe_handler) ecore_event_handler_del(sd->exe_handler);
    if (sd->cycle_timer) ecore_timer_del(sd->cycle_timer);
+
+   sd->thumb_exe = NULL;
+   sd->file = NULL;
+   sd->realfile = NULL;
+   sd->realpath = NULL;
+   sd->o_img = NULL;
+   sd->o_img2 = NULL;
+   sd->exe_handler = NULL;
+   sd->cycle_timer = NULL;
+
    _parent_sc.del(obj);
 }
 
@@ -531,6 +539,7 @@ _cb_cycle(void *data)
 {
    Evas_Object *obj = data;
    Videothumb *sd = evas_object_smart_data_get(obj);
+   if (!sd) return EINA_FALSE;
    if (sd->poster)
      {
         sd->cycle_timer = NULL;

-- 


Reply via email to