static isc_boolean_t
exit_check(dns_zone_t *zone) {
-
REQUIRE(LOCKED_ZONE(zone));
- if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_SHUTDOWN) &&
- zone->irefs == 0)
- {
+ if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_SHUTDOWN) && zone->irefs == 0) {
/*
* DNS_ZONEFLG_SHUTDOWN can only be set if erefs == 0.
*/
zone->statelist = NULL;
}
RWUNLOCK(&zone->zmgr->rwlock, isc_rwlocktype_write);
- dns_zonemgr_releasezone(zone->zmgr, zone);
}
/*
if (zone->xfr != NULL)
dns_xfrin_shutdown(zone->xfr);
+ /* Safe to release the zone now */
+ if (zone->zmgr != NULL)
+ dns_zonemgr_releasezone(zone->zmgr, zone);
+
LOCK_ZONE(zone);
INSIST(zone != zone->raw);
if (linked) {