mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 16:06:16 +01:00
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.
This commit is contained in:
parent
aa20167d41
commit
730a75fc8e
@ -585,7 +585,6 @@ g_main_context_unref (GMainContext *context)
|
|||||||
source = s_iter->data;
|
source = s_iter->data;
|
||||||
g_source_destroy_internal (source, context, TRUE);
|
g_source_destroy_internal (source, context, TRUE);
|
||||||
}
|
}
|
||||||
UNLOCK_CONTEXT (context);
|
|
||||||
|
|
||||||
for (sl_iter = context->source_lists; sl_iter; sl_iter = sl_iter->next)
|
for (sl_iter = context->source_lists; sl_iter; sl_iter = sl_iter->next)
|
||||||
{
|
{
|
||||||
@ -596,6 +595,7 @@ g_main_context_unref (GMainContext *context)
|
|||||||
|
|
||||||
g_hash_table_destroy (context->sources);
|
g_hash_table_destroy (context->sources);
|
||||||
|
|
||||||
|
UNLOCK_CONTEXT (context);
|
||||||
g_mutex_clear (&context->mutex);
|
g_mutex_clear (&context->mutex);
|
||||||
|
|
||||||
g_ptr_array_free (context->pending_dispatches, TRUE);
|
g_ptr_array_free (context->pending_dispatches, TRUE);
|
||||||
|
Loading…
Reference in New Issue
Block a user