void flux_handle_destroy (flux_t *hp) { if (hp) { flux_t h = *hp; if (h && --h->usecount == 0) { zhash_destroy (&h->aux); if (h->ops->impl_destroy) h->ops->impl_destroy (h->impl); tagpool_destroy (h->tagpool); if (h->dso) dlclose (h->dso); msglist_destroy (h->queue); if (h->pollfd >= 0) (void)close (h->pollfd); free (h); } *hp = NULL; } }
void flux_handle_destroy (flux_t *h) { if (h && --h->usecount == 0) { zhash_destroy (&h->aux); if ((h->flags & FLUX_O_CLONE)) { flux_handle_destroy (h->parent); // decr usecount } else { if (h->ops->impl_destroy) h->ops->impl_destroy (h->impl); tagpool_destroy (h->tagpool); if (h->dso) dlclose (h->dso); msglist_destroy (h->queue); if (h->pollfd >= 0) (void)close (h->pollfd); } free (h); } }