[glib/mcatanzaro/glib-2-56-rhel8: 39/45] GMainContext - Move mutex unlocking in destructor right before freeing the mutex




commit 712cbb2825bba87765e2b7d48498d3a890f9ad9e
Author: Sebastian Dröge <sebastian centricular com>
Date:   Tue Feb 11 09:34:38 2020 +0200

    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.

 glib/gmain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/gmain.c b/glib/gmain.c
index 1c249ad02..44e6ed0c3 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -580,7 +580,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)
     {
@@ -591,6 +590,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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]