void ADC_client_destroy(struct ADC_client* client) { ADC_TRACE; ADC_client_disconnect(client); ioq_send_destroy(client->send_queue); ioq_recv_destroy(client->recv_queue); hub_free(client->timer); adc_msg_free(client->info); hub_free(client->nick); hub_free(client->desc); hub_free(client->address.hostname); hub_free(client); if (g_adc_client && g_adc_client->references > 0) { g_adc_client->references--; if (!g_adc_client->references) { #ifdef SSL_SUPPORT net_ssl_context_destroy(g_adc_client->ctx); g_adc_client->ctx = NULL; #endif hub_free(g_adc_client); g_adc_client = NULL; } } }
void user_destroy(struct hub_user* user) { LOG_TRACE("user_destroy(), user=%p", user); ioq_recv_destroy(user->recv_queue); ioq_send_destroy(user->send_queue); if (user->connection) { LOG_TRACE("user_destory() -> net_con_close(%p)", user->connection); net_con_close(user->connection); } adc_msg_free(user->info); user_clear_feature_cast_support(user); hub_free(user); }