/** * Logoff and deallocate a session. * * @param od Session to kill */ void oscar_data_destroy(OscarData *od) { aim_cleansnacs(od, -1); while (od->requesticon) { gchar *sn = od->requesticon->data; od->requesticon = g_slist_remove(od->requesticon, sn); g_free(sn); } g_free(od->email); g_free(od->newp); g_free(od->oldp); if (od->icontimer > 0) gaim_timeout_remove(od->icontimer); if (od->getblisttimer > 0) gaim_timeout_remove(od->getblisttimer); if (od->getinfotimer > 0) gaim_timeout_remove(od->getinfotimer); while (od->oscar_connections != NULL) flap_connection_destroy(od->oscar_connections->data, OSCAR_DISCONNECT_DONE, NULL); while (od->peer_connections != NULL) peer_connection_destroy(od->peer_connections->data, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); aim__shutdownmodules(od); g_hash_table_destroy(od->buddyinfo); g_hash_table_destroy(od->handlerlist); g_free(od); }
/** * Logoff and deallocate a session. * * @param od Session to kill */ void oscar_data_destroy(OscarData *od) { aim_cleansnacs(od, -1); /* Only used when connecting with clientLogin */ if (od->url_data != NULL) purple_util_fetch_url_cancel(od->url_data); while (od->requesticon) { g_free(od->requesticon->data); od->requesticon = g_slist_delete_link(od->requesticon, od->requesticon); } g_free(od->email); g_free(od->newp); g_free(od->oldp); if (od->getblisttimer > 0) purple_timeout_remove(od->getblisttimer); while (od->oscar_connections != NULL) flap_connection_destroy(od->oscar_connections->data, OSCAR_DISCONNECT_DONE, NULL); while (od->peer_connections != NULL) peer_connection_destroy(od->peer_connections->data, OSCAR_DISCONNECT_LOCAL_CLOSED, NULL); aim__shutdownmodules(od); g_hash_table_destroy(od->buddyinfo); g_hash_table_destroy(od->handlerlist); g_free(od); }