void flux_msg_handler_destroy (flux_msg_handler_t *w) { if (w) { assert (w->magic == HANDLER_MAGIC); flux_msg_handler_stop (w); if (w->match.topic_glob) free (w->match.topic_glob); if (w->coproc) coproc_destroy (w->coproc); if (w->backlog) { flux_msg_t *msg; while ((msg = zlist_pop (w->backlog))) flux_msg_destroy (msg); zlist_destroy (&w->backlog); } if (w->wait_match.topic_glob) free (w->wait_match.topic_glob); if (w->arg_free) w->arg_free (w->arg); w->magic = ~HANDLER_MAGIC; dispatch_usecount_decr (w->d); free (w); } }
static void dispatch_destroy (void *arg) { struct dispatch *d = arg; dispatch_usecount_decr (d); }