/* Either it's a new one or it's being reconfigured. */
REQUIRE(catzs->view == NULL || !strcmp(catzs->view->name, view->name));
- catzs->view = view;
+ if (catzs->view == NULL) {
+ dns_view_weakattach(view, &catzs->view);
+ } else if (catzs->view != view) {
+ dns_view_weakdetach(&catzs->view);
+ dns_view_weakattach(view, &catzs->view);
+ }
}
dns_catz_zone_t *
catzs->magic = 0;
isc_mutex_destroy(&catzs->lock);
-
+ if (catzs->view != NULL) {
+ dns_view_weakdetach(&catzs->view);
+ }
isc_mem_putanddetach(&catzs->mctx, catzs, sizeof(*catzs));
}