[Fix][icmpv6_recv] No need to free data using xs_cleanup(), data is already freed...
[platform/upstream/connman.git] / src / proxy.c
old mode 100644 (file)
new mode 100755 (executable)
index 0d1a25a..e1bc420
@@ -44,6 +44,9 @@ struct proxy_lookup {
 
 static void remove_lookup(struct proxy_lookup *lookup)
 {
+       if (lookup->watch > 0)
+               g_source_remove(lookup->watch);
+
        lookup_list = g_slist_remove(lookup_list, lookup);
 
        connman_service_unref(lookup->service);
@@ -120,7 +123,7 @@ unsigned int connman_proxy_lookup(const char *interface, const char *url,
        lookup->url = g_strdup(url);
        lookup->service = connman_service_ref(service);
 
-       lookup->watch = g_timeout_add_seconds(0, lookup_callback, lookup);
+       lookup->watch = g_idle_add(lookup_callback, lookup);
        if (lookup->watch == 0) {
                g_free(lookup->url);
                g_free(lookup);
@@ -150,11 +153,6 @@ void connman_proxy_lookup_cancel(unsigned int token)
        }
 
        if (lookup) {
-               if (lookup->watch > 0) {
-                       g_source_remove(lookup->watch);
-                       lookup->watch = 0;
-               }
-
                if (lookup->proxy &&
                                        lookup->proxy->cancel_lookup)
                        lookup->proxy->cancel_lookup(lookup->service,