libpurple/account.c

branch
soc.2013.gobjectification.plugins
changeset 37108
73c5fb6d78b3
parent 37101
8ba9a23354ff
parent 35512
8d6f1349b57a
child 37144
8b63b9948107
--- a/libpurple/account.c	Mon Feb 10 03:17:49 2014 +0530
+++ b/libpurple/account.c	Mon Feb 10 16:22:00 2014 +0530
@@ -898,7 +898,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);
@@ -916,11 +916,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);
@@ -2940,7 +2940,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