]> git.meshlink.io Git - catta/commitdiff
* make sure to free some more time events
authorLennart Poettering <lennart@poettering.net>
Fri, 17 Jun 2005 14:07:31 +0000 (14:07 +0000)
committerLennart Poettering <lennart@poettering.net>
Fri, 17 Jun 2005 14:07:31 +0000 (14:07 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@124 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/resolve-address.c
avahi-core/resolve-host-name.c

index 53e4468eea47f68e07e438baa915a382a86194d6..07cbef4f403bd89dd536722ae3de2e09c87ac5eb 100644 (file)
@@ -46,8 +46,10 @@ static void finish(AvahiAddressResolver *r, gint interface, guchar protocol, Ava
     avahi_record_browser_free(r->record_browser);
     r->record_browser = NULL;
 
-    avahi_time_event_queue_remove(r->server->time_event_queue, r->time_event);
-    r->time_event = NULL;
+    if (r->time_event) {
+        avahi_time_event_queue_remove(r->server->time_event_queue, r->time_event);
+        r->time_event = NULL;
+    }
 
     r->callback(r, interface, protocol, event, &r->address, record ? record->data.ptr.name : NULL, r->userdata);
 }
@@ -109,7 +111,6 @@ AvahiAddressResolver *avahi_address_resolver_new(AvahiServer *server, gint inter
     
     r->record_browser = avahi_record_browser_new(server, interface, protocol, k, record_browser_callback, r);
     avahi_key_unref(k);
-
     
     return r;
 }
index 2cfd43569b51fab43fb7e1cb1fd7df9ce16dec47..c10119a4fccfc6eea4da5c116914b3264bad94d0 100644 (file)
@@ -55,9 +55,11 @@ static void finish(AvahiHostNameResolver *r, gint interface, guchar protocol, Av
         avahi_record_browser_free(r->record_browser_aaaa);
         r->record_browser_aaaa = NULL;
     }
-    avahi_time_event_queue_remove(r->server->time_event_queue, r->time_event);
-    r->time_event = NULL;
+
+    if (r->time_event) {
+        avahi_time_event_queue_remove(r->server->time_event_queue, r->time_event);
+        r->time_event = NULL;
+    }
 
     if (record) {
         switch (record->key->type) {
@@ -148,8 +150,12 @@ void avahi_host_name_resolver_free(AvahiHostNameResolver *r) {
 
     if (r->record_browser_a)
         avahi_record_browser_free(r->record_browser_a);
+
     if (r->record_browser_aaaa)
         avahi_record_browser_free(r->record_browser_aaaa);
+
+    if (r->time_event)
+        avahi_time_event_queue_remove(r->server->time_event_queue, r->time_event);
     
     g_free(r->host_name);
     g_free(r);