Fix crash on wrong password (backout 0f0d6ae2fb77)

Mon, 10 Feb 2014 16:21:13 +0530

author
Ankit Vani <a@nevitus.org>
date
Mon, 10 Feb 2014 16:21:13 +0530
changeset 35512
8d6f1349b57a
parent 35511
201a7fd12507
child 35514
5c61e87ce68d
child 37108
73c5fb6d78b3

Fix crash on wrong password (backout 0f0d6ae2fb77)

libpurple/account.c file | annotate | diff | comparison | revisions
--- a/libpurple/account.c	Sun Feb 09 19:09:10 2014 -0500
+++ b/libpurple/account.c	Mon Feb 10 16:21:13 2014 +0530
@@ -903,7 +903,7 @@
 {
 	PurpleConnection *gc;
 	PurpleAccountPrivate *priv;
-	gboolean was_enabled = FALSE, wants_to_die = FALSE;
+	gboolean was_enabled = FALSE;
 
 	g_return_if_fail(PURPLE_IS_ACCOUNT(account));
 	g_return_if_fail(ui != NULL);
@@ -921,11 +921,11 @@
 	g_object_notify_by_pspec(G_OBJECT(account), properties[PROP_ENABLED]);
 
 	if ((gc != NULL) && (_purple_connection_wants_to_die(gc)))
-		wants_to_die = TRUE;
+		return;
 
 	priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
 
-	if (!wants_to_die && value && purple_presence_is_online(priv->presence))
+	if (value && purple_presence_is_online(priv->presence))
 		purple_account_connect(account);
 	else if (!value && !purple_account_is_disconnected(account))
 		purple_account_disconnect(account);
@@ -2980,7 +2980,11 @@
 static void
 purple_account_dispose(GObject *object)
 {
-	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(object);
+	PurpleAccount *account = PURPLE_ACCOUNT(object);
+	PurpleAccountPrivate *priv = PURPLE_ACCOUNT_GET_PRIVATE(account);
+
+	if (!purple_account_is_disconnected(account))
+		purple_account_disconnect(account);
 
 	if (priv->presence) {
 		g_object_unref(priv->presence);

mercurial