MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / mainloop_gio_destroy

Function mainloop_gio_destroy

lib/common/mainloop.c:635–662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

633}
634
635static void
636mainloop_gio_destroy(gpointer c)
637{
638 mainloop_io_t *client = c;
639
640 /* client->source is valid but about to be destroyed (ref_count == 0) in gmain.c
641 * client->channel will still have ref_count > 0... should be == 1
642 */
643 crm_trace("Destroying client %s[%p] %d", client->name, c, mainloop_gio_refcount(client));
644
645 if(client->ipc) {
646 crm_ipc_close(client->ipc);
647 }
648
649 if(client->destroy_fn) {
650 client->destroy_fn(client->userdata);
651 }
652
653 if(client->ipc) {
654 crm_ipc_destroy(client->ipc);
655 }
656
657 crm_trace("Destroyed client %s[%p] %d", client->name, c, mainloop_gio_refcount(client));
658 free(client->name);
659
660 memset(client, 0, sizeof(mainloop_io_t)); /* A bit of pointless paranoia */
661 free(client);
662}
663
664mainloop_io_t *
665mainloop_add_ipc_client(

Callers

nothing calls this directly

Calls 3

mainloop_gio_refcountFunction · 0.85
crm_ipc_closeFunction · 0.85
crm_ipc_destroyFunction · 0.85

Tested by

no test coverage detected