summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2012-07-18 14:19:36 -0400
committerDan Winship <danw@gnome.org>2012-07-18 14:19:36 -0400
commitee6e66cb4483d82fcb0657d13faebf844258c70b (patch)
tree1a847cd853de2c431e379c19ff1716aaf7b6fd39
parent2855b827da44144c76b72d8cfec9599a835df4ea (diff)
downloadglib-ee6e66cb4483d82fcb0657d13faebf844258c70b.tar.gz
g_source_add_child_source: sync blocked state
Child sources are supposed to be blocked when their parents are, so when adding a source to a blocked source, block the child too. Fixes a warning when unblocking the parent.
-rw-r--r--glib/gmain.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/glib/gmain.c b/glib/gmain.c
index d9dc76e50..443d42357 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -400,6 +400,8 @@ static gboolean g_idle_dispatch (GSource *source,
GSourceFunc callback,
gpointer user_data);
+static void block_source (GSource *source);
+
static GMainContext *glib_worker_context;
G_LOCK_DEFINE_STATIC (main_loop);
@@ -1325,6 +1327,8 @@ g_source_add_child_source (GSource *source,
g_source_ref (child_source));
child_source->priv->parent_source = source;
g_source_set_priority_unlocked (child_source, NULL, source->priority);
+ if (SOURCE_BLOCKED (source))
+ block_source (child_source);
if (context)
{