mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 04:56:14 +01:00
Fix a refcounting error
'new' is created floating, therefore it is consumed by g_settings_set, and unreffing it after that call is not right.
This commit is contained in:
parent
6784468625
commit
8852d4e9a0
@ -457,6 +457,7 @@ gsettings_set (GSettings *settings,
|
||||
|
||||
existing = g_settings_get_value (settings, key);
|
||||
type = g_variant_get_type (existing);
|
||||
g_variant_unref (existing);
|
||||
|
||||
new = g_variant_parse (type, value, NULL, NULL, &error);
|
||||
|
||||
@ -503,8 +504,6 @@ gsettings_set (GSettings *settings,
|
||||
}
|
||||
|
||||
g_settings_set_value (settings, key, new);
|
||||
g_variant_unref (existing);
|
||||
g_variant_unref (new);
|
||||
|
||||
g_settings_sync ();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user