mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-10 04:45:48 +01:00
GSettingsBackend: allow floating refs from read()
Use g_variant_take_ref() to allow for backends to return floating GVariant instances from their read() implementations.
This commit is contained in:
parent
1b03377442
commit
6e7da987b4
@ -733,6 +733,9 @@ g_settings_backend_read (GSettingsBackend *backend,
|
|||||||
value = G_SETTINGS_BACKEND_GET_CLASS (backend)
|
value = G_SETTINGS_BACKEND_GET_CLASS (backend)
|
||||||
->read (backend, key, expected_type, default_value);
|
->read (backend, key, expected_type, default_value);
|
||||||
|
|
||||||
|
if (value != NULL)
|
||||||
|
value = g_variant_take_ref (value);
|
||||||
|
|
||||||
if G_UNLIKELY (value && !g_variant_is_of_type (value, expected_type))
|
if G_UNLIKELY (value && !g_variant_is_of_type (value, expected_type))
|
||||||
{
|
{
|
||||||
g_variant_unref (value);
|
g_variant_unref (value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user