Don't leak variants in the null settings backend

Even though the write fails, the variant still needs to be consumed.

Bug #638872.
This commit is contained in:
Christian Persch 2011-01-06 23:30:09 +01:00
parent a583405f66
commit 8728949e0d

View File

@ -56,6 +56,18 @@ g_null_settings_backend_write (GSettingsBackend *backend,
GVariant *value,
gpointer origin_tag)
{
if (value)
g_variant_unref (g_variant_ref_sink (value));
return FALSE;
}
static gboolean
g_null_settings_backend_write_one (gpointer key,
gpointer value,
gpointer data)
{
if (value)
g_variant_unref (g_variant_ref_sink (value));
return FALSE;
}
@ -64,6 +76,7 @@ g_null_settings_backend_write_tree (GSettingsBackend *backend,
GTree *tree,
gpointer origin_tag)
{
g_tree_foreach (tree, g_null_settings_backend_write_one, backend);
return FALSE;
}