Merge lp:~3v1n0/unity-control-center/fix-grouped-gsettings-set into lp:unity-control-center

Proposed by Marco Trevisan (Treviño) on 2017-07-06
Status: Merged
Approved by: Sebastien Bacher on 2017-07-10
Approved revision: 12915
Merged at revision: 12892
Proposed branch: lp:~3v1n0/unity-control-center/fix-grouped-gsettings-set
Merge into: lp:unity-control-center
Prerequisite: lp:~3v1n0/unity-control-center/fix-ui-paddings
Diff against target: 29 lines (+7/-1)
1 file modified
panels/appearance/cc-appearance-panel.c (+7/-1)
To merge this branch: bzr merge lp:~3v1n0/unity-control-center/fix-grouped-gsettings-set
Reviewer Review Type Date Requested Status
Sebastien Bacher 2017-07-06 Approve on 2017-07-10
Review via email: mp+326974@code.launchpad.net

Commit message

GroupedGSettings: ensure we ref the variant's before setting them

Otherwise when we set floating references they get consumed
by the first call to g_settings_set_value and the value becomes
invalid. Thus we need to remove the floating reference, and
manually ref and unref.

To post a comment you must log in.
12915. By Marco Trevisan (Treviño) on 2017-07-06

appearance: fix a typo causing not using the proper variable on vsize

Not triggering a bug for how the code is made, though.

Sebastien Bacher (seb128) wrote :

thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panels/appearance/cc-appearance-panel.c'
2--- panels/appearance/cc-appearance-panel.c 2017-06-27 23:36:48 +0000
3+++ panels/appearance/cc-appearance-panel.c 2017-07-06 23:31:49 +0000
4@@ -468,10 +468,16 @@
5 GVariant *value)
6 {
7 GList *l;
8+
9 g_return_if_fail (IS_GSETTINGS_GROUPED (self));
10+ g_return_if_fail (g_variant_get_type (value));
11+
12+ g_variant_ref_sink (value);
13
14 for (l = self->priv->settings_list; l; l = l->next)
15 g_settings_set_value (G_SETTINGS (l->data), key, value);
16+
17+ g_variant_unref (value);
18 }
19
20 static GSettings *
21@@ -1864,7 +1870,7 @@
22 }
23
24 grouped_gsettings_set_value (priv->compizcore_compiz_gs, COMPIZCORE_HSIZE_KEY, g_variant_new_int32 (hsize));
25- grouped_gsettings_set_value (priv->compizcore_compiz_gs, COMPIZCORE_VSIZE_KEY, g_variant_new_int32 (hsize));
26+ grouped_gsettings_set_value (priv->compizcore_compiz_gs, COMPIZCORE_VSIZE_KEY, g_variant_new_int32 (vsize));
27 }
28
29 static void

Subscribers

People subscribed via source and target branches