Mercurial > pidgin
changeset 5926:6c22d37c6a3c
[gaim-migrate @ 6366]
Another "should fix" commit! If calling gaim_connection_disconnect()
instead of gaim_account_disconnect() (which was happening at times), the
account's connection would never be set to NULL. Now we ensure that if the
account's connection is non-NULL, gaim_account_disconnect() is called first
instead of gaim_connection_disconnect().
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Fri, 20 Jun 2003 03:55:56 +0000 |
parents | 6690934e5ea6 |
children | 04dc7fe68889 |
files | src/account.c src/connection.c |
diffstat | 2 files changed, 14 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/account.c Fri Jun 20 03:41:15 2003 +0000 +++ b/src/account.c Fri Jun 20 03:55:56 2003 +0000 @@ -176,12 +176,16 @@ void gaim_account_disconnect(GaimAccount *account) { + GaimConnection *gc; + g_return_if_fail(account != NULL); g_return_if_fail(gaim_account_is_connected(account)); - gaim_connection_disconnect(account->gc); + gc = gaim_account_get_connection(account); - account->gc = NULL; + gaim_account_set_connection(account, NULL); + + gaim_connection_disconnect(gc); } void
--- a/src/connection.c Fri Jun 20 03:41:15 2003 +0000 +++ b/src/connection.c Fri Jun 20 03:55:56 2003 +0000 @@ -120,10 +120,18 @@ void gaim_connection_disconnect(GaimConnection *gc) { + GaimAccount *account; GList *wins; g_return_if_fail(gc != NULL); + account = gaim_connection_get_account(gc); + + if (gaim_account_get_connection(account) != NULL) { + gaim_account_disconnect(account); + return; + } + if (gaim_connection_get_state(gc) != GAIM_DISCONNECTED) { if (gaim_connection_get_state(gc) != GAIM_CONNECTING) gaim_blist_remove_account(gaim_connection_get_account(gc));