projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b03377
)
GSettingsBackend: allow floating refs from read()
author
Ryan Lortie
<desrt@desrt.ca>
Thu, 22 Dec 2011 05:24:20 +0000
(
00:24
-0500)
committer
Ryan Lortie
<desrt@desrt.ca>
Thu, 22 Dec 2011 05:24:20 +0000
(
00:24
-0500)
Use g_variant_take_ref() to allow for backends to return floating
GVariant instances from their read() implementations.
gio/gsettingsbackend.c
patch
|
blob
|
history
diff --git
a/gio/gsettingsbackend.c
b/gio/gsettingsbackend.c
index
6ea88d2
..
6075d7f
100644
(file)
--- a/
gio/gsettingsbackend.c
+++ b/
gio/gsettingsbackend.c
@@
-733,6
+733,9
@@
g_settings_backend_read (GSettingsBackend *backend,
value = G_SETTINGS_BACKEND_GET_CLASS (backend)
->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))
{
g_variant_unref (value);