2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Fixed multiple shutdown cleanup bugs in the zone object. This

involved extensive restructuring of the reference counting of
zones and related objects.

Zones now attach to their views.  To avoid a circular dependency that
would keep views from ever shutting down, this is done using the new
functions dns_view_weakattach() / dns_view_weakdetach() which
guarantee that the view will not be freed but still allow it
to be shut down.

The zones themselves now only have a single reference count, with
similar "weak" semantics.  Managed zones must now be shut down
explicitly by calling dns_zone_shutdown().  To shut down all
zones in a zone table, call dns_zt_shutdown().

The zone manager is now reference counted, weakly. To shut down the
zone manager, you must explicitly call dns_zonemgr_shutdown().
This commit is contained in:
Andreas Gustafsson
2000-05-17 19:45:36 +00:00
parent bc436be071
commit 22608315e8
8 changed files with 304 additions and 219 deletions

View File

@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: xfrin.c,v 1.69 2000/05/14 20:01:27 gson Exp $ */
/* $Id: xfrin.c,v 1.70 2000/05/17 19:45:29 gson Exp $ */
#include <config.h>
@@ -605,7 +605,7 @@ xfrin_create(isc_mem_t *mctx,
xfr->mctx = mctx;
xfr->refcount = 0;
xfr->zone = NULL;
dns_zone_iattach(zone, &xfr->zone);
dns_zone_attach(zone, &xfr->zone);
xfr->task = NULL;
isc_task_attach(task, &xfr->task);
xfr->timer = NULL;
@@ -1180,7 +1180,7 @@ maybe_free(dns_xfrin_ctx_t *xfr) {
dns_db_detach(&xfr->db);
if (xfr->zone != NULL)
dns_zone_idetach(&xfr->zone);
dns_zone_detach(&xfr->zone);
isc_mem_put(xfr->mctx, xfr, sizeof(*xfr));
}