void xcb_disconnect(xcb_connection_t *c) { if(c->has_error) return; free(c->setup); close(c->fd); pthread_mutex_destroy(&c->iolock); _xcb_in_destroy(&c->in); _xcb_out_destroy(&c->out); _xcb_ext_destroy(c); _xcb_xid_destroy(c); free(c); }
void xcb_disconnect(xcb_connection_t *c) { if(c->has_error) return; free(c->setup); /* disallow further sends and receives */ shutdown(c->fd, SHUT_RDWR); close(c->fd); pthread_mutex_destroy(&c->iolock); _xcb_in_destroy(&c->in); _xcb_out_destroy(&c->out); _xcb_ext_destroy(c); _xcb_xid_destroy(c); free(c); }