mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 09:46:17 +01:00
Allow NULL to be stored into GSettings trees
This is used for resets (in theory) and currently it crashes when freeing the tree.
This commit is contained in:
parent
720d6ec8e4
commit
a38c97af51
@ -918,6 +918,13 @@ g_settings_backend_class_init (GSettingsBackendClass *class)
|
||||
g_type_class_add_private (class, sizeof (GSettingsBackendPrivate));
|
||||
}
|
||||
|
||||
static void
|
||||
g_settings_backend_variant_unref0 (gpointer data)
|
||||
{
|
||||
if (data != NULL)
|
||||
g_variant_unref (data);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* g_settings_backend_create_tree:
|
||||
* @returns: a new #GTree
|
||||
@ -930,7 +937,7 @@ GTree *
|
||||
g_settings_backend_create_tree (void)
|
||||
{
|
||||
return g_tree_new_full ((GCompareDataFunc) strcmp, NULL,
|
||||
g_free, (GDestroyNotify) g_variant_unref);
|
||||
g_free, g_settings_backend_variant_unref0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user