soc.2010.detachablepurple: ead0d0a6: Various bugfixes in the RunCallback sigh...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Wed Jul 28 19:25:47 EDT 2010


----------------------------------------------------------------------
Revision: ead0d0a6b74556e38e9823d074f0af1fd481e191
Parent:   d225874339aecd68f8cd641e6ca7dd367c644f91
Author:   gillux at soc.pidgin.im
Date:     07/28/10 19:06:19
Branch:   im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/ead0d0a6b74556e38e9823d074f0af1fd481e191

Changelog: 

Various bugfixes in the RunCallback sighandler.

Changes against parent d225874339aecd68f8cd641e6ca7dd367c644f91

  patched  libpurple/dbus-callback.c

-------------- next part --------------
============================================================
--- libpurple/dbus-callback.c	f747cb61398ed24e325357cbd164cfdb4045dc06
+++ libpurple/dbus-callback.c	fbcb214c638e3d5226ab87d72ef0d3aa944a39e4
@@ -168,7 +168,13 @@ build_args_list(unsigned int n_args, ...
 	va_start(ap, n_args);
 	for (i = 0; i < n_args; i++) {
 		val = g_new0(GValue, 1);
+#if GLIB_CHECK_VERSION(2, 24, 0)
+		/* A more optimized way */
 		G_VALUE_COLLECT_INIT(val, va_arg(ap, GType), ap, 0, &err);
+#else
+		g_value_init(val, va_arg(ap, GType));
+		G_VALUE_COLLECT(val, ap, 0, &err);
+#endif
 		if (err) {
 			g_warning("%s\n", err);
 			g_free(err);
@@ -214,7 +220,7 @@ run_callback_cb(DBusGProxy *proxy, const
 	obj = purple_dbus_get_gobject_by_path(dbus_g_proxy_get_path(proxy));
 	g_return_if_fail(obj != NULL);
 
-	purple_debug_info("dbus", "Running callback %llu\n", callback_id, params->len);
+	purple_debug_info("dbus", "Running callback %llu\n", callback_id);
 
 	/* Build the GValue array for the closure */
 	values = g_new0(GValue, params->len+1);
@@ -222,8 +228,8 @@ run_callback_cb(DBusGProxy *proxy, const
 	g_value_init(&values[0], G_TYPE_OBJECT);
 	g_value_set_object(&values[0], obj);
 	/* Then the received parameters */
-	for (i = 1; i < params->len; i++)
-		memcpy(&values[i], params->pdata[i], sizeof(GValue));
+	for (i = 0; i < params->len; i++)
+		memcpy(&values[i+1], params->pdata[i], sizeof(GValue));
 	g_closure_invoke(closure, NULL, params->len+1, values, NULL);
 
 	g_free(values);


More information about the Commits mailing list