changeset 22224:d1b36a8c920a

Change some g_idle_add(...) calls in libpurple to purple_timeout_add(0, ...) We need to use the purple functions here so we can hook into mainloops other than gtk, which is important for Adium. Felipe pointed out the call in msnp9 and grep found the others.
author Mark Doliner <mark@kingant.net>
date Sun, 27 Jan 2008 20:52:53 +0000
parents 19ace070f0e5
children d2fc168b5e7a
files libpurple/dnssrv.c libpurple/idle.c libpurple/protocols/msnp9/msn.c libpurple/stringref.c
diffstat 4 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/dnssrv.c	Sun Jan 27 10:44:51 2008 +0000
+++ b/libpurple/dnssrv.c	Sun Jan 27 20:52:53 2008 +0000
@@ -315,7 +315,7 @@
 
 	/* back to main thread */
 	/* Note: this should *not* be attached to query_data->handle - it will cause leakage */
-	g_idle_add(res_main_thread_cb, query_data);
+	purple_timeout_add(0, res_main_thread_cb, query_data);
 
 	g_thread_exit(NULL);
 	return NULL;
@@ -410,7 +410,7 @@
 	 * Asynchronously call the callback since stuff may not expect
 	 * the callback to be called before this returns */
 	if (query_data->error_message != NULL)
-		query_data->handle = g_idle_add(res_main_thread_cb, query_data);
+		query_data->handle = purple_timeout_add(0, res_main_thread_cb, query_data);
 
 	return query_data;
 #endif
--- a/libpurple/idle.c	Sun Jan 27 10:44:51 2008 +0000
+++ b/libpurple/idle.c	Sun Jan 27 20:52:53 2008 +0000
@@ -24,6 +24,7 @@
 
 #include "connection.h"
 #include "debug.h"
+#include "eventloop.h"
 #include "idle.h"
 #include "log.h"
 #include "prefs.h"
@@ -333,7 +334,7 @@
 
 	/* Initialize the idleness asynchronously so it doesn't check idleness,
 	 * and potentially try to change the status before the UI is initialized */
-	g_idle_add(_do_purple_idle_touch_cb, NULL);
+	purple_timeout_add(0, _do_purple_idle_touch_cb, NULL);
 
 }
 
--- a/libpurple/protocols/msnp9/msn.c	Sun Jan 27 10:44:51 2008 +0000
+++ b/libpurple/protocols/msnp9/msn.c	Sun Jan 27 20:52:53 2008 +0000
@@ -27,6 +27,7 @@
 
 #include "msn.h"
 #include "accountopt.h"
+#include "eventloop.h"
 #include "msg.h"
 #include "page.h"
 #include "pluginpref.h"
@@ -856,7 +857,7 @@
 		imdata->msg = body_str;
 		imdata->flags = flags;
 		imdata->when = time(NULL);
-		g_idle_add(msn_send_me_im, imdata);
+		purple_timeout_add(0, msn_send_me_im, imdata);
 	}
 
 	msn_message_destroy(msg);
--- a/libpurple/stringref.c	Sun Jan 27 10:44:51 2008 +0000
+++ b/libpurple/stringref.c	Sun Jan 27 20:52:53 2008 +0000
@@ -31,6 +31,7 @@
 #include <stdarg.h>
 
 #include "debug.h"
+#include "eventloop.h"
 #include "stringref.h"
 
 /**
@@ -87,7 +88,7 @@
 	newref->ref = 0x80000000;
 
 	if (gclist == NULL)
-		g_idle_add(gs_idle_cb, NULL);
+		purple_timeout_add(0, gs_idle_cb, NULL);
 	gclist = g_list_prepend(gclist, newref);
 
 	return newref;