Example #1
0
void *connection_data_free (connection_data *conn) {
  if (conn->write_timer) { purple_timeout_remove (conn->write_timer); }
  if (conn->login_timer) { purple_timeout_remove (conn->login_timer); }
  if (conn->out_timer) { purple_timeout_remove (conn->out_timer); }

  tgp_g_queue_free_full (conn->new_messages, tgp_msg_loading_free);
  tgp_g_queue_free_full (conn->out_messages, tgp_msg_sending_free);
  tgp_g_list_free_full (conn->used_images, used_image_free);
  tgp_g_list_free_full (conn->pending_joins, g_free);
  g_hash_table_destroy (conn->pending_reads);
  g_hash_table_destroy (conn->pending_chat_info);
  g_hash_table_destroy (conn->id_to_purple_name);
  g_hash_table_destroy (conn->purple_name_to_id);
  tgprpl_xfer_free_all (conn);
  g_free (conn->TLS->base_path);
  tgl_free_all (conn->TLS);
 
  free (conn);
  return NULL;
}
Example #2
0
static void tgprpl_close (PurpleConnection * gc) {
  debug ("tgprpl_close()\n");
  telegram_conn *conn = purple_connection_get_protocol_data(gc);
  purple_timeout_remove(conn->timer);
  tgl_free_all (conn->TLS);
}