mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
gdelayedsettingsbackend: Fix applying after calling g_settings_reset()
`g_settings_reset()` changes the value of the setting to `NULL`; `add_to_tree()` was not handling that correctly. Add a unit test. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2426
This commit is contained in:
@@ -156,7 +156,8 @@ add_to_tree (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_tree_insert (user_data, g_strdup (key), g_variant_ref (value));
|
||||
/* A value may be %NULL if its key has been reset */
|
||||
g_tree_insert (user_data, g_strdup (key), (value != NULL) ? g_variant_ref (value) : NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user