diff options
author | Alexander Larsson <alexl@redhat.com> | 2011-03-25 10:53:05 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2011-03-28 12:49:17 +0200 |
commit | e274dbbdced7f3f8e6349bdfadcd743326cfa799 (patch) | |
tree | c0fea71a27490754c6dcf34b54e1ead9334ead5a /gtk/gtksearchenginetracker.c | |
parent | f5e03849391cd602420aa06fdb449741b8aa75bd (diff) | |
download | gtk+-e274dbbdced7f3f8e6349bdfadcd743326cfa799.tar.gz |
Ensure we always grab the gdk lock in async callbacks
Async callbacks are delivered in idles, so we need to make sure
we get the gdk lock before calling any gdk/gtk stuff. This was
missing in a few places.
Diffstat (limited to 'gtk/gtksearchenginetracker.c')
-rw-r--r-- | gtk/gtksearchenginetracker.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/gtksearchenginetracker.c b/gtk/gtksearchenginetracker.c index 641e7938eb..68346fa43e 100644 --- a/gtk/gtksearchenginetracker.c +++ b/gtk/gtksearchenginetracker.c @@ -203,6 +203,8 @@ cursor_callback (GObject *object, GList *hits; gboolean success; + gdk_threads_enter (); + tracker = GTK_SEARCH_ENGINE_TRACKER (user_data); cursor = TRACKER_SPARQL_CURSOR (object); @@ -217,6 +219,7 @@ cursor_callback (GObject *object, if (cursor) g_object_unref (cursor); + gdk_threads_leave (); return; } @@ -227,6 +230,7 @@ cursor_callback (GObject *object, if (cursor) g_object_unref (cursor); + gdk_threads_leave (); return; } @@ -237,6 +241,9 @@ cursor_callback (GObject *object, /* Get next */ cursor_next (tracker, cursor); + + gdk_threads_leave (); + } static void @@ -249,6 +256,8 @@ query_callback (GObject *object, TrackerSparqlCursor *cursor; GError *error = NULL; + gdk_threads_enter (); + tracker = GTK_SEARCH_ENGINE_TRACKER (user_data); tracker->priv->query_pending = FALSE; @@ -264,16 +273,19 @@ query_callback (GObject *object, { _gtk_search_engine_error (GTK_SEARCH_ENGINE (tracker), error->message); g_error_free (error); + gdk_threads_leave (); return; } if (!cursor) { _gtk_search_engine_finished (GTK_SEARCH_ENGINE (tracker)); + gdk_threads_leave (); return; } cursor_next (tracker, cursor); + gdk_threads_leave (); } static void |