barbieri pushed a commit to branch master.

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

commit fba2743361d5a149f9d9ccc7642dc209da523c01
Author: Gustavo Sverzut Barbieri <barbi...@profusion.mobi>
Date:   Mon Aug 29 14:49:03 2016 -0300

    efl_net_dialer_http: cancel curl multi timer when it's gone.
    
    If we delete the curl multi handle, then we should stop any timer that
    was scheduled, otherwise it will use a dead or null pointer.
    
    also add some debug to help track down when the multi handle is
    deleted.
---
 src/lib/ecore_con/efl_net_dialer_http.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/lib/ecore_con/efl_net_dialer_http.c 
b/src/lib/ecore_con/efl_net_dialer_http.c
index d3a4b55..f80bd4e 100644
--- a/src/lib/ecore_con/efl_net_dialer_http.c
+++ b/src/lib/ecore_con/efl_net_dialer_http.c
@@ -522,6 +522,9 @@ static void
 _efl_net_dialer_http_curlm_remove(Efl_Net_Dialer_Http_Curlm *cm, Eo *o, CURL 
*handle)
 {
    CURLMcode r = curl_multi_remove_handle(cm->multi, handle);
+
+   DBG("removed handle cm=%p multi=%p easy=%p: %s",
+       cm, cm->multi, handle, curl_multi_strerror(r));
    if (r != CURLM_OK)
      {
         ERR("could not unregister curl multi handle %p: %s",
@@ -531,8 +534,15 @@ 
_efl_net_dialer_http_curlm_remove(Efl_Net_Dialer_Http_Curlm *cm, Eo *o, CURL *ha
    cm->users = eina_list_remove(cm->users, o);
    if (!cm->users)
      {
+        DBG("cleaned up cm=%p multi=%p", cm, cm->multi);
         curl_multi_cleanup(cm->multi);
         cm->multi = NULL;
+
+        if (cm->timer)
+          {
+             efl_del(cm->timer);
+             cm->timer = NULL;
+          }
      }
 }
 

-- 


Reply via email to