From: Lennart Poettering Date: Fri, 17 Jun 2005 14:04:15 +0000 (+0000) Subject: * free timeout event when destroying service resolver X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=2d8306950f20e3341ddd66adfdd5feceee3660e5;p=catta * free timeout event when destroying service resolver git-svn-id: file:///home/lennart/svn/public/avahi/trunk@123 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-core/resolve-service.c b/avahi-core/resolve-service.c index e854cca..deb4cdb 100644 --- a/avahi-core/resolve-service.c +++ b/avahi-core/resolve-service.c @@ -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)