From 9f5afe3966d31ef6f1e880d950206a0325e6c777 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Sun, 22 Sep 2013 23:34:27 +0300 Subject: [PATCH] glib/tests/mainloop: Acquire the context while asserting its state The iteration methods presume that the context is acquired. https://bugzilla.gnome.org/show_bug.cgi?id=699132 --- glib/tests/mainloop.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/glib/tests/mainloop.c b/glib/tests/mainloop.c index df1dfb6..8abd262 100644 --- a/glib/tests/mainloop.c +++ b/glib/tests/mainloop.c @@ -1213,6 +1213,7 @@ assert_main_context_state (gint n_to_poll, GMainContext *context; gboolean consumed[10] = { }; GPollFD poll_fds[10]; + gboolean acquired; gboolean immediate; gint max_priority; gint timeout; @@ -1222,6 +1223,9 @@ assert_main_context_state (gint n_to_poll, context = g_main_context_default (); + acquired = g_main_context_acquire (context); + g_assert (acquired); + immediate = g_main_context_prepare (context, &max_priority); g_assert (!immediate); n = g_main_context_query (context, max_priority, &timeout, poll_fds, 10); @@ -1254,6 +1258,8 @@ assert_main_context_state (gint n_to_poll, if (g_main_context_check (context, max_priority, poll_fds, n)) g_main_context_dispatch (context); + + g_main_context_release (context); } static gboolean -- 2.7.4