C-Ares-DNS: when destructing make shure all events are stopped.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 26 Feb 2012 12:54:39 +0000 (13:54 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 26 Feb 2012 12:54:39 +0000 (13:54 +0100)
citadel/modules/c-ares-dns/serv_c-ares-dns.c

index 278dd0c8a86c0868730d6dd43dbb5d8ad2520e80..58142f5ed14630b5322dc55e119923e6a2bce5aa 100644 (file)
@@ -297,7 +297,16 @@ void QueryCbDone(AsyncIO *IO)
 
 void DestructCAres(AsyncIO *IO)
 {
+#ifdef DEBUG_CARES
+       EV_syslog(LOG_DEBUG, "C-ARES: %s\n", __FUNCTION__);
+       EV_DNS_LOGT_STOP(DNS.timeout);
+#endif
+       EV_DNS_LOG_STOP(DNS.recv_event);
+       ev_io_stop(event_base, &IO->DNS.recv_event);
+       EV_DNS_LOG_STOP(DNS.send_event);
+       ev_io_stop(event_base, &IO->DNS.send_event);
        ev_timer_stop (event_base, &IO->DNS.timeout);
+       ev_idle_stop(event_base, &IO->unwind_stack);
        ares_destroy_options(&IO->DNS.Options);
 }