Make sure all zone's plugin are unloaded before the zone gets freed.
This makes passing zone metadata like its origin to the plugin
registering function safe, as this garantee that the origin would always
be valid from the plugin lifecycle.
REQUIRE(zone->timer == NULL);
REQUIRE(zone->zmgr == NULL);
+ dns_zone_unloadplugins(zone);
+
isc_refcount_destroy(&zone->references);
isc_refcount_destroy(&zone->irefs);
if (zone->gluecachestats != NULL) {
isc_stats_detach(&zone->gluecachestats);
}
- dns_zone_unloadplugins(zone);
/* last stuff */
ZONEDB_DESTROYLOCK(&zone->dblock);