summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--avahi-compat-libdns_sd/compat.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/avahi-compat-libdns_sd/compat.c b/avahi-compat-libdns_sd/compat.c
index 0306c2f..9fbe731 100644
--- a/avahi-compat-libdns_sd/compat.c
+++ b/avahi-compat-libdns_sd/compat.c
@@ -64,7 +64,7 @@ struct _DNSServiceRef_t {
int thread_running;
pthread_mutex_t mutex;
-
+
void *context;
DNSServiceBrowseReply service_browser_callback;
DNSServiceResolveReply service_resolver_callback;
@@ -336,7 +336,6 @@ static void sdref_free(DNSServiceRef sdref) {
if (sdref->simple_poll)
avahi_simple_poll_free(sdref->simple_poll);
-
if (sdref->thread_fd >= 0)
close(sdref->thread_fd);
@@ -388,9 +387,9 @@ DNSServiceErrorType DNSSD_API DNSServiceProcessResult(DNSServiceRef sdref) {
AVAHI_WARN_LINKAGE;
- sdref_ref(sdref);
-
ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex));
+
+ sdref_ref(sdref);
/* Cleanup notification socket */
if (read_command(sdref->main_fd) != COMMAND_POLL_DONE)
@@ -415,9 +414,9 @@ DNSServiceErrorType DNSSD_API DNSServiceProcessResult(DNSServiceRef sdref) {
finish:
- ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex));
-
sdref_unref(sdref);
+
+ ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex));
return ret;
}