| 633 | } |
| 634 | |
| 635 | static void |
| 636 | mainloop_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 | |
| 664 | mainloop_io_t * |
| 665 | mainloop_add_ipc_client( |
nothing calls this directly
no test coverage detected