* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: zone.c,v 1.329 2001/07/11 23:15:14 marka Exp $ */
+/* $Id: zone.c,v 1.330 2001/07/17 02:49:44 marka Exp $ */
#include <config.h>
REQUIRE(isc_refcount_current(&zone->erefs) == 0);
REQUIRE(zone->irefs == 0);
REQUIRE(!LOCKED_ZONE(zone));
+ REQUIRE(zone->timer == NULL);
/*
* Managed objects. Order is important.
*/
- if (zone->timer != NULL)
- isc_timer_detach(&zone->timer);
if (zone->request != NULL)
dns_request_destroy(&zone->request); /* XXXMPA */
INSIST(zone->readio == NULL);
REQUIRE(LOCKED_ZONE(source));
REQUIRE(DNS_ZONE_VALID(source));
REQUIRE(target != NULL && *target == NULL);
+ INSIST(source->irefs + isc_refcount_current(&source->erefs) > 0);
source->irefs++;
INSIST(source->irefs != 0);
*target = source;
static void
zone_shutdown(isc_task_t *task, isc_event_t *event) {
dns_zone_t *zone = (dns_zone_t *) event->ev_arg;
- isc_result_t result;
isc_boolean_t free_needed;
UNUSED(task);
notify_cancel(zone);
if (zone->timer != NULL) {
- result = isc_timer_reset(zone->timer, isc_timertype_inactive,
- NULL, NULL, ISC_TRUE);
- RUNTIME_CHECK(result == ISC_R_SUCCESS);
+ isc_timer_detach(&zone->timer);
+ INSIST(zone->irefs > 0);
+ zone->irefs--;
}
if (zone->view != NULL)
&zone->timer);
if (result != ISC_R_SUCCESS)
goto cleanup_task;
+ /*
+ * The timer "holds" a iref.
+ */
+ zone->irefs++;
+ INSIST(zone->irefs != 0);
ISC_LIST_APPEND(zmgr->zones, zone, link);
zone->zmgr = zmgr;