summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2020-02-11 09:34:38 +0200
committerPhilip Withnall <withnall@endlessm.com>2020-02-12 15:33:25 +0000
commit8258bbfee136ebf4a802dd6a7ef985346b31359d (patch)
tree7bcd286a07572a818ff143e9ab72ef4be731e9b1
parentc278612318e7954614e92749e7de984a37df8f97 (diff)
downloadglib-8258bbfee136ebf4a802dd6a7ef985346b31359d.tar.gz
GMainContext - Move mutex unlocking in destructor right before freeing the mutex
This does not have any behaviour changes but is cleaner. The mutex is only unlocked now after all operations on the context are done and right before freeing the mutex and the context itself.
-rw-r--r--glib/gmain.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/glib/gmain.c b/glib/gmain.c
index 10ba2f874..b1df470e1 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -584,7 +584,6 @@ g_main_context_unref (GMainContext *context)
source = s_iter->data;
g_source_destroy_internal (source, context, TRUE);
}
- UNLOCK_CONTEXT (context);
for (sl_iter = context->source_lists; sl_iter; sl_iter = sl_iter->next)
{
@@ -595,6 +594,7 @@ g_main_context_unref (GMainContext *context)
g_hash_table_destroy (context->sources);
+ UNLOCK_CONTEXT (context);
g_mutex_clear (&context->mutex);
g_ptr_array_free (context->pending_dispatches, TRUE);