[tracker/tracker-0.10] libtracker-sparql: Use thread-default main context for async callback



commit 0be5990e22d7c29a5061fc4c025f51524e942b18
Author: Jürg Billeter <j bitron ch>
Date:   Mon Mar 21 15:16:03 2011 +0100

    libtracker-sparql: Use thread-default main context for async callback
    
    This fixes the main context used for invoking the async ready callback
    of tracker_sparql_connection_get_async.
    
    Fixes NB#238547.

 src/libtracker-sparql/tracker-connection.vala |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-sparql/tracker-connection.vala b/src/libtracker-sparql/tracker-connection.vala
index f1a2a32..291b77d 100644
--- a/src/libtracker-sparql/tracker-connection.vala
+++ b/src/libtracker-sparql/tracker-connection.vala
@@ -135,6 +135,7 @@ public abstract class Tracker.Sparql.Connection : Object {
 		IOError io_error = null;
 		DBusError dbus_error = null;
 		Connection result = null;
+		var context = MainContext.get_thread_default ();
 
 		g_io_scheduler_push_job (job => {
 			try {
@@ -146,10 +147,14 @@ public abstract class Tracker.Sparql.Connection : Object {
 			} catch (DBusError e_dbus) {
 				dbus_error = e_dbus;
 			}
-			Idle.add (() => {
+
+			var source = new IdleSource ();
+			source.set_callback (() => {
 				get_internal_async.callback ();
 				return false;
 			});
+			source.attach (context);
+
 			return false;
 		});
 		yield;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]