/* clean up the given QQ connection and free all resources */ static void qq_close(PurpleConnection *gc) { qq_data *qd; g_return_if_fail(gc != NULL && gc->proto_data); qd = gc->proto_data; if (qd->check_watcher > 0) { purple_timeout_remove(qd->check_watcher); qd->check_watcher = 0; } if (qd->connect_watcher > 0) { purple_timeout_remove(qd->connect_watcher); qd->connect_watcher = 0; } /* This is cancelled by _purple_connection_destroy */ qd->conn_data = NULL; qq_disconnect(gc); if (qd->redirect) g_free(qd->redirect); if (qd->ld.token) g_free(qd->ld.token); if (qd->ld.token_ex) g_free(qd->ld.token_ex); if (qd->captcha.token) g_free(qd->captcha.token); if (qd->captcha.data) g_free(qd->captcha.data); server_list_remove_all(qd); g_free(qd); gc->proto_data = NULL; }
/* clean up the given QQ connection and free all resources */ static void qq_close(PurpleConnection *gc) { qq_data *qd; guint8 i; g_return_if_fail(gc != NULL && gc->proto_data); qd = gc->proto_data; if (qd->check_watcher > 0) { purple_timeout_remove(qd->check_watcher); qd->check_watcher = 0; } if (qd->connect_watcher > 0) { purple_timeout_remove(qd->connect_watcher); qd->connect_watcher = 0; } /* This is cancelled by _purple_connection_destroy */ qd->conn_data = NULL; qq_disconnect(gc); if (qd->redirect) g_free(qd->redirect); if (qd->ld.token_touch) g_free(qd->ld.token_touch); if (qd->ld.token_captcha) g_free(qd->ld.token_captcha); if (qd->captcha.token) g_free(qd->captcha.token); if (qd->captcha.data) g_free(qd->captcha.data); if (qd->ld.token_auth) { for (i=0; i<4; ++i) if (qd->ld.token_auth[i]) g_free(qd->ld.token_auth[i]); g_free(qd->ld.token_auth); } if (qd->ld.token_verify) { for (i=0; i<3; ++i) if (qd->ld.token_verify[i]) g_free(qd->ld.token_verify[i]); if (qd->ld.token_verify) g_free(qd->ld.token_verify); } if (qd->ld.token_login) g_free(qd->ld.token_login); if (qd->ld.token_verify_de) g_free(qd->ld.token_verify_de); server_list_remove_all(qd); g_free(qd); gc->proto_data = NULL; }