summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/dconf-engine.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c
index 251974a..9e4b358 100644
--- a/engine/dconf-engine.c
+++ b/engine/dconf-engine.c
@@ -254,18 +254,18 @@ dconf_engine_new (const gchar *profile,
engine->free_func = free_func;
engine->ref_count = 1;
- /* The engine starts with zero sources, which means that every key is
- * effectively locked. If the engine has more than zero sources, this
- * will be updated when the first refresh is done.
- */
- engine->has_locks = TRUE;
-
g_mutex_init (&engine->sources_lock);
g_mutex_init (&engine->queue_lock);
g_cond_init (&engine->queue_cond);
engine->sources = dconf_engine_profile_open (profile, &engine->n_sources);
+ /* We need to provide a reasonable initial value here. We do not
+ * inspect the sources themselves for having locks, because this will
+ * be done the first time the engine is acquired.
+ */
+ engine->has_locks = engine->n_sources == 0 || !engine->sources[0]->writable;
+
g_mutex_lock (&dconf_engine_global_lock);
dconf_engine_global_list = g_slist_prepend (dconf_engine_global_list, engine);
g_mutex_unlock (&dconf_engine_global_lock);