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

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Sebastien Bacher
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 Approve
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)

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

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

Revision history for this message
Sebastien Bacher (seb128) wrote :

thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'panels/appearance/cc-appearance-panel.c'
--- panels/appearance/cc-appearance-panel.c 2017-06-27 23:36:48 +0000
+++ panels/appearance/cc-appearance-panel.c 2017-07-06 23:31:49 +0000
@@ -468,10 +468,16 @@
468 GVariant *value)468 GVariant *value)
469{469{
470 GList *l;470 GList *l;
471
471 g_return_if_fail (IS_GSETTINGS_GROUPED (self));472 g_return_if_fail (IS_GSETTINGS_GROUPED (self));
473 g_return_if_fail (g_variant_get_type (value));
474
475 g_variant_ref_sink (value);
472476
473 for (l = self->priv->settings_list; l; l = l->next)477 for (l = self->priv->settings_list; l; l = l->next)
474 g_settings_set_value (G_SETTINGS (l->data), key, value);478 g_settings_set_value (G_SETTINGS (l->data), key, value);
479
480 g_variant_unref (value);
475}481}
476482
477static GSettings *483static GSettings *
@@ -1864,7 +1870,7 @@
1864 }1870 }
18651871
1866 grouped_gsettings_set_value (priv->compizcore_compiz_gs, COMPIZCORE_HSIZE_KEY, g_variant_new_int32 (hsize));1872 grouped_gsettings_set_value (priv->compizcore_compiz_gs, COMPIZCORE_HSIZE_KEY, g_variant_new_int32 (hsize));
1867 grouped_gsettings_set_value (priv->compizcore_compiz_gs, COMPIZCORE_VSIZE_KEY, g_variant_new_int32 (hsize));1873 grouped_gsettings_set_value (priv->compizcore_compiz_gs, COMPIZCORE_VSIZE_KEY, g_variant_new_int32 (vsize));
1868}1874}
18691875
1870static void1876static void

Subscribers

People subscribed via source and target branches