isc_mutex_t lock;
isc_mem_t *mctx; /* Main cache memory */
isc_mem_t *hmctx; /* Heap memory */
+ isc_loop_t *loop;
char *name;
isc_refcount_t references;
dns_db_setservestalettl(*db, cache->serve_stale_ttl);
dns_db_setservestalerefresh(*db, cache->serve_stale_refresh);
}
+
+ dns_db_setloop(cache->db, cache->loop);
+
return (result);
}
.hmctx = hmctx,
.rdclass = rdclass,
.name = isc_mem_strdup(mctx, cachename),
+ .loop = isc_loop_ref(isc_loop_main(loopmgr)),
};
isc_mutex_init(&cache->lock);
isc_stats_detach(&cache->stats);
isc_mutex_destroy(&cache->lock);
isc_mem_free(mctx, cache->name);
+ isc_loop_detach(&cache->loop);
isc_mem_detach(&cache->hmctx);
isc_mem_putanddetach(&cache->mctx, cache, sizeof(*cache));
return (result);
isc_mutex_destroy(&cache->lock);
+ isc_loop_detach(&cache->loop);
+
cache->magic = 0;
isc_mem_detach(&cache->hmctx);
isc_mem_putanddetach(&cache->mctx, cache, sizeof(*cache));