void guac_client_free(guac_client* client) { if (client->free_handler) { /* FIXME: Errors currently ignored... */ client->free_handler(client); } /* Free layer pools */ guac_pool_free(client->__buffer_pool); guac_pool_free(client->__layer_pool); /* Free streams */ free(client->__input_streams); free(client->__output_streams); /* Free stream pool */ guac_pool_free(client->__stream_pool); free(client); }
void guac_client_free(guac_client* client) { /* Remove all users */ while (client->__users != NULL) guac_client_remove_user(client, client->__users); if (client->free_handler) { /* FIXME: Errors currently ignored... */ client->free_handler(client); } /* Free socket */ guac_socket_free(client->socket); /* Free layer pools */ guac_pool_free(client->__buffer_pool); guac_pool_free(client->__layer_pool); /* Free streams */ free(client->__output_streams); /* Free stream pool */ guac_pool_free(client->__stream_pool); /* Close associated plugin */ if (client->__plugin_handle != NULL) { if (dlclose(client->__plugin_handle)) guac_client_log(client, GUAC_LOG_ERROR, "Unable to close plugin: %s", dlerror()); } pthread_rwlock_destroy(&(client->__users_lock)); free(client->connection_id); free(client); }