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:
Ryan Lortie
2010-10-03 17:30:10 -04:00
parent 92974b80fc
commit 0bd50b39eb
3 changed files with 33 additions and 72 deletions

View File

@@ -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);
}