]> git.meshlink.io Git - catta/commitdiff
* free timeout event when destroying service resolver
authorLennart Poettering <lennart@poettering.net>
Fri, 17 Jun 2005 14:04:15 +0000 (14:04 +0000)
committerLennart Poettering <lennart@poettering.net>
Fri, 17 Jun 2005 14:04:15 +0000 (14:04 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@123 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/resolve-service.c

index e854cca8f5fdc6fc0bb797bbf08c071ed5380fff..deb4cdb53d33c2fca76dafffad75a88af79cb0c1 100644 (file)
@@ -75,9 +75,11 @@ static void finish(AvahiServiceResolver *r, AvahiResolverEvent event) {
         avahi_record_browser_free(r->record_browser_txt);
         r->record_browser_txt = 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 (event == AVAHI_RESOLVER_TIMEOUT)
         r->callback(r, r->interface, r->protocol, event, r->service_name, r->service_type, r->domain_name, NULL, NULL, 0, NULL, r->userdata);
@@ -244,6 +246,9 @@ void avahi_service_resolver_free(AvahiServiceResolver *r) {
 
     AVAHI_LLIST_REMOVE(AvahiServiceResolver, resolver, r->server->service_resolvers, r);
 
+    if (r->time_event)
+        avahi_time_event_queue_remove(r->server->time_event_queue, r->time_event);
+    
     if (r->record_browser_srv)
         avahi_record_browser_free(r->record_browser_srv);
     if (r->record_browser_txt)