# HG changeset patch # User Mark Doliner # Date 1201467173 0 # Node ID d1b36a8c920a43136bf383eee3e6d4d75705189c # Parent 19ace070f0e515b41000510fe123204f1ca9bb2b 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. diff -r 19ace070f0e5 -r d1b36a8c920a libpurple/dnssrv.c --- 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 diff -r 19ace070f0e5 -r d1b36a8c920a libpurple/idle.c --- 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); } diff -r 19ace070f0e5 -r d1b36a8c920a libpurple/protocols/msnp9/msn.c --- 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); diff -r 19ace070f0e5 -r d1b36a8c920a libpurple/stringref.c --- 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 #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;