mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
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:
parent
a583405f66
commit
8728949e0d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user