improve thread safety in GDelayedSettingsBackend

- hold a lock while accessing the tree of delayed values
  - use weak reference counts with the owner object to avoid doing
    g_object_notify on a dead object
  - dispatch the "has-unapplied" notify to the proper main context
This commit is contained in:
Ryan Lortie
2010-05-16 16:56:36 -04:00
parent 61219e2640
commit 799e0242ae
5 changed files with 121 additions and 24 deletions

View File

@@ -410,7 +410,9 @@ g_settings_delay (GSettings *settings)
return;
settings->priv->delayed =
g_delayed_settings_backend_new (settings->priv->backend, settings);
g_delayed_settings_backend_new (settings->priv->backend,
settings,
settings->priv->main_context);
g_settings_backend_unwatch (settings->priv->backend, G_OBJECT (settings));
g_object_unref (settings->priv->backend);