cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=70aa45829ae5460bbe0da10ab1fca8308a3a83bf

commit 70aa45829ae5460bbe0da10ab1fca8308a3a83bf
Author: Cedric Bail <[email protected]>
Date:   Wed Jun 15 10:45:40 2016 -0700

    ecore: prevent crash in case of double ecore_timer_del in legacy case.
---
 src/lib/ecore/ecore_timer.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/lib/ecore/ecore_timer.c b/src/lib/ecore/ecore_timer.c
index a01d810..b7fce54 100644
--- a/src/lib/ecore/ecore_timer.c
+++ b/src/lib/ecore/ecore_timer.c
@@ -235,6 +235,15 @@ ecore_timer_del(Ecore_Timer *timer)
    EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
 
    legacy = eo_key_data_get(timer, "_legacy");
+   // If legacy == NULL, this means double free or something
+   if (legacy == NULL)
+     {
+        // Just in case it is an Eo timer, but not a legacy one.
+        ERR("You are trying to destroy a timer which seems dead already.");
+        eo_unref(timer);
+        return NULL;
+     }
+
    data = (void*) legacy->data;
 
    if (legacy->inside_call)

-- 


Reply via email to