Esempio n. 1
0
static void waprpl_close(PurpleConnection *gc) {
  whatsapp_connection * wconn = purple_connection_get_protocol_data(gc);
  
  if (wconn->rh)
    purple_input_remove(wconn->rh);
  if (wconn->wh)
    purple_input_remove(wconn->wh);
  
  if (wconn->fd >= 0)
    close(wconn->fd);
  
  if (wconn->waAPI)
    waAPI_delete(wconn->waAPI);

  g_free(wconn);
}
Esempio n. 2
0
static void waprpl_close(PurpleConnection * gc)
{
	whatsapp_connection *wconn = purple_connection_get_protocol_data(gc);

	if (wconn->rh)
		purple_input_remove(wconn->rh);
	if (wconn->wh)
		purple_input_remove(wconn->wh);
	if (wconn->timer)
		purple_timeout_remove(wconn->timer);

	if (wconn->fd >= 0)
		sys_close(wconn->fd);

	if (wconn->waAPI)
		waAPI_delete(wconn->waAPI);
	wconn->waAPI = NULL;

	g_free(wconn);
	purple_connection_set_protocol_data(gc, 0);
}