From 38cce0e6032f760ca98228907b9d7c6068269aeb Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 17 Jun 2005 14:07:31 +0000 Subject: [PATCH] * make sure to free some more time events git-svn-id: file:///home/lennart/svn/public/avahi/trunk@124 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/resolve-address.c | 7 ++++--- avahi-core/resolve-host-name.c | 12 +++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/avahi-core/resolve-address.c b/avahi-core/resolve-address.c index 53e4468..07cbef4 100644 --- a/avahi-core/resolve-address.c +++ b/avahi-core/resolve-address.c @@ -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; } diff --git a/avahi-core/resolve-host-name.c b/avahi-core/resolve-host-name.c index 2cfd435..c10119a 100644 --- a/avahi-core/resolve-host-name.c +++ b/avahi-core/resolve-host-name.c @@ -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); -- 2.39.5