diff libpurple/account.c @ 22054:658785fe1992

This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 09 Jan 2008 22:14:17 +0000
parents c38d72677c8a
children e21cdaffbcdb
line wrap: on
line diff
--- a/libpurple/account.c	Wed Jan 09 19:10:27 2008 +0000
+++ b/libpurple/account.c	Wed Jan 09 22:14:17 2008 +0000
@@ -1219,7 +1219,11 @@
 	if (ops != NULL && ops->close_account_request != NULL)
 		ops->close_account_request(info->ui_handle);
 
+	/* TODO: This will leak info->user_data, but there is no callback to just clean that up */
+
+	g_free(info->user);
 	g_free(info);
+
 }
 
 void
@@ -1264,9 +1268,14 @@
 request_auth_cb(void *data)
 {
 	PurpleAccountRequestInfo *info = data;
+
+	handles = g_list_remove(handles, info);
+
 	info->auth_cb(info->userdata);
+
 	purple_signal_emit(purple_accounts_get_handle(),
 			"account-authorization-granted", info->account, info->user);
+
 	g_free(info->user);
 	g_free(info);
 }
@@ -1275,9 +1284,14 @@
 request_deny_cb(void *data)
 {
 	PurpleAccountRequestInfo *info = data;
+
+	handles = g_list_remove(handles, info);
+
 	info->deny_cb(info->userdata);
+
 	purple_signal_emit(purple_accounts_get_handle(),
 			"account-authorization-denied", info->account, info->user);
+
 	g_free(info->user);
 	g_free(info);
 }