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:
6784468
)
Fix a refcounting error
author
Matthias Clasen
<mclasen@redhat.com>
Fri, 20 Jan 2012 13:02:26 +0000
(08:02 -0500)
committer
Matthias Clasen
<mclasen@redhat.com>
Fri, 20 Jan 2012 13:03:38 +0000
(08:03 -0500)
'new' is created floating, therefore it is consumed by
g_settings_set, and unreffing it after that call is not right.
gio/gsettings-tool.c
patch
|
blob
|
history
diff --git
a/gio/gsettings-tool.c
b/gio/gsettings-tool.c
index
e84eb35
..
993fa59
100644
(file)
--- a/
gio/gsettings-tool.c
+++ b/
gio/gsettings-tool.c
@@
-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 ();