/** delete libworker env */ static void libworker_delete_env(struct libworker* w) { if(w->env) { outside_network_quit_prepare(w->back); mesh_delete(w->env->mesh); context_release_alloc(w->ctx, w->env->alloc, !w->is_bg || w->is_bg_thread); sldns_buffer_free(w->env->scratch_buffer); regional_destroy(w->env->scratch); forwards_delete(w->env->fwds); hints_delete(w->env->hints); ub_randfree(w->env->rnd); free(w->env); } #ifdef HAVE_SSL SSL_CTX_free(w->sslctx); #endif outside_network_delete(w->back); }
/** delete libworker struct */ static void libworker_delete(struct libworker* w) { if(!w) return; if(w->env) { outside_network_quit_prepare(w->back); mesh_delete(w->env->mesh); context_release_alloc(w->ctx, w->env->alloc, !w->is_bg || w->is_bg_thread); ldns_buffer_free(w->env->scratch_buffer); regional_destroy(w->env->scratch); forwards_delete(w->env->fwds); ub_randfree(w->env->rnd); free(w->env); } SSL_CTX_free(w->sslctx); outside_network_delete(w->back); comm_base_delete(w->base); free(w); }