soc.2009.telepathy: 6a0b5a39: Connect to account related signals outsi...

sttwister at soc.pidgin.im sttwister at soc.pidgin.im
Tue Jul 21 08:05:50 EDT 2009


-----------------------------------------------------------------
Revision: 6a0b5a39c426e76b54e6aaededf424447a77fdae
Ancestor: f62cfb20a9b0c1b4d333c8288f55d329511b9924
Author: sttwister at soc.pidgin.im
Date: 2009-07-21T11:43:44
Branch: im.pidgin.soc.2009.telepathy
URL: http://d.pidgin.im/viewmtn/revision/info/6a0b5a39c426e76b54e6aaededf424447a77fdae

Modified files:
        libpurple/protocols/telepathy/telepathy_account.c

ChangeLog: 

Connect to account related signals outside loop. Fixed a crash

-------------- next part --------------
============================================================
--- libpurple/protocols/telepathy/telepathy_account.c	38ab4b19e706df5d4af87a879c2928e371792fa5
+++ libpurple/protocols/telepathy/telepathy_account.c	3f4e5f3746d1dbcb74d3d0edc5e71812f0bb32bd
@@ -437,8 +437,8 @@ account_added_cb (PurpleAccount *account
 	account_data = g_new0(telepathy_account, 1);
 
 	account_data->account = account;
-	account_data->cm = (gchar *)tp_connection_manager_get_name(data->cm);
-	account_data->protocol = data->protocol->name;
+	account_data->cm = g_strdup((gchar *)tp_connection_manager_get_name(data->cm));
+	account_data->protocol = g_strdup(data->protocol->name);
 
 	purple_account_set_int(account, "tp_account_data", (int)account_data);
 
@@ -516,27 +516,27 @@ get_valid_accounts_cb (TpProxy *proxy,
 		tp_cli_dbus_properties_call_get_all(account, -1, TP_IFACE_ACCOUNT,
 				get_account_properties_cb, account_data, NULL, NULL);
 
-		/* FIXME: Is purple_accounts_get_handle() the right one to pass as the handle?
-		 * I honestly have no idea, seems to fail with a NULL :|
-		 *
-		 * FIXME: account-modified is Pidgin-dependent
-		 */
-		purple_signal_connect(pidgin_account_get_handle(), "account-modified",
-				purple_accounts_get_handle(),
-				PURPLE_CALLBACK(account_modified_cb),
-				NULL);
+	}
 
-		purple_signal_connect(purple_accounts_get_handle(), "account-destroying",
-				purple_accounts_get_handle(),
-				PURPLE_CALLBACK(account_destroying_cb),
-				NULL);
+	/* FIXME: Is purple_accounts_get_handle() the right one to pass as the handle?
+	 * I honestly have no idea, seems to fail with a NULL :|
+	 *
+	 * FIXME: account-modified is Pidgin-dependent
+	 */
+	purple_signal_connect(pidgin_account_get_handle(), "account-modified",
+		purple_accounts_get_handle(),
+		PURPLE_CALLBACK(account_modified_cb),
+		NULL);
 
-		purple_signal_connect(purple_accounts_get_handle(), "account-added",
-				purple_accounts_get_handle(),
-				PURPLE_CALLBACK(account_added_cb),
-				NULL);
-	}
+	purple_signal_connect(purple_accounts_get_handle(), "account-destroying",
+		purple_accounts_get_handle(),
+		PURPLE_CALLBACK(account_destroying_cb),
+		NULL);
 
+	purple_signal_connect(purple_accounts_get_handle(), "account-added",
+		purple_accounts_get_handle(),
+		PURPLE_CALLBACK(account_added_cb),
+		NULL);
 	if (daemon)
 		g_object_unref(daemon);
 


More information about the Commits mailing list