[tracker/tracker-0.10] libtracker-direct: Use thread-default main context for async callback
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.10] libtracker-direct: Use thread-default main context for async callback
- Date: Wed, 30 Mar 2011 16:08:14 +0000 (UTC)
commit 33158eafabbac4d5febdef474190a281ce1048bb
Author: Jürg Billeter <j bitron ch>
Date: Mon Mar 28 17:55:46 2011 +0200
libtracker-direct: Use thread-default main context for async callback
This fixes the main context used for invoking the async ready callback
of tracker_direct_connection_query_async.
Fixes GB#645963.
src/libtracker-direct/tracker-direct.vala | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-direct/tracker-direct.vala b/src/libtracker-direct/tracker-direct.vala
index d19a3f9..9abf5b7 100644
--- a/src/libtracker-direct/tracker-direct.vala
+++ b/src/libtracker-direct/tracker-direct.vala
@@ -79,6 +79,7 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection {
IOError io_error = null;
DBusError dbus_error = null;
Sparql.Cursor result = null;
+ var context = MainContext.get_thread_default ();
g_io_scheduler_push_job (job => {
try {
@@ -90,7 +91,14 @@ public class Tracker.Direct.Connection : Tracker.Sparql.Connection {
} catch (DBusError e_dbus) {
dbus_error = e_dbus;
}
- query_async.callback ();
+
+ var source = new IdleSource ();
+ source.set_callback (() => {
+ query_async.callback ();
+ return false;
+ });
+ source.attach (context);
+
return false;
});
yield;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]