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/gtkrecentmanager.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/gtkrecentmanager.c')
-rw-r--r-- | gtk/gtkrecentmanager.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c index 76bbf3ff8e..a33b58a012 100644 --- a/gtk/gtkrecentmanager.c +++ b/gtk/gtkrecentmanager.c @@ -524,7 +524,9 @@ gtk_recent_manager_monitor_changed (GFileMonitor *monitor, { case G_FILE_MONITOR_EVENT_CHANGED: case G_FILE_MONITOR_EVENT_CREATED: + gdk_threads_enter (); gtk_recent_manager_changed (manager); + gdk_threads_leave (); break; case G_FILE_MONITOR_EVENT_DELETED: @@ -768,6 +770,8 @@ gtk_recent_manager_add_item_query_info (GObject *source_object, recent_data.groups = NULL; recent_data.is_private = FALSE; + gdk_threads_enter (); + /* Ignore return value, this can't fail anyway since all required * fields are set */ gtk_recent_manager_add_full (manager, uri, &recent_data); @@ -775,6 +779,8 @@ gtk_recent_manager_add_item_query_info (GObject *source_object, manager->priv->is_dirty = TRUE; gtk_recent_manager_changed (manager); + gdk_threads_leave (); + g_free (recent_data.mime_type); g_free (recent_data.app_name); g_free (recent_data.app_exec); |