mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-25 02:18:55 +02:00
Bug 623400 - acquire context before dispatching
For GSettings. Use the functionality introduced in the last commit to simplify our notify dispatching and increase the safety of doing so (by ensuring that the context is acquired in the current thread for the duration of the dispatch). This closes bugs #623400 and #629849.
This commit is contained in:
@@ -70,21 +70,7 @@ g_delayed_settings_backend_notify_unapplied (GDelayedSettingsBackend *delayed)
|
||||
g_static_mutex_unlock (&delayed->priv->lock);
|
||||
|
||||
if (target != NULL)
|
||||
{
|
||||
if (g_settings_backend_get_active_context () != target_context)
|
||||
{
|
||||
GSource *source;
|
||||
|
||||
source = g_idle_source_new ();
|
||||
g_source_set_priority (source, G_PRIORITY_DEFAULT);
|
||||
g_source_set_callback (source, invoke_notify_unapplied,
|
||||
target, g_object_unref);
|
||||
g_source_attach (source, target_context);
|
||||
g_source_unref (source);
|
||||
}
|
||||
else
|
||||
invoke_notify_unapplied (target);
|
||||
}
|
||||
g_main_context_invoke (target_context, invoke_notify_unapplied, target);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user