mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-03 14:42:10 +01:00
g_settings_reset(): add precondition checks
Ensure that @key is non-%NULL on g_settings_reset(). It turns out that using g_settings_reset() with %NULL key (although invalid as per the API documentation and not possible via bindings) accidentally produces the same effect as the _reset_all() API that we are about to add. Add the standard precondition checks to prevent that from happening. https://bugzilla.gnome.org/show_bug.cgi?id=744678
This commit is contained in:
parent
fdd0ed1972
commit
ca03753853
@ -2338,6 +2338,9 @@ g_settings_reset (GSettings *settings,
|
||||
{
|
||||
gchar *path;
|
||||
|
||||
g_return_if_fail (G_IS_SETTINGS (settings));
|
||||
g_return_if_fail (key != NULL);
|
||||
|
||||
path = g_strconcat (settings->priv->path, key, NULL);
|
||||
g_settings_backend_reset (settings->priv->backend, path, NULL);
|
||||
g_free (path);
|
||||
|
Loading…
x
Reference in New Issue
Block a user