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:
Ryan Lortie 2011-05-07 11:41:19 +02:00
parent 720d6ec8e4
commit a38c97af51

View File

@ -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);
}
/**