~unity-control-center-team/unity-control-center/18.10

« back to all changes in this revision

Viewing changes to panels/appearance/cc-appearance-panel.c

  • Committer: Bileto Bot
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2017-07-10 11:00:57 UTC
  • mfrom: (12885.3.3 ucc)
  • Revision ID: ci-train-bot@canonical.com-20170710110057-22eh8c0bvjyunr8f
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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
468
468
                             GVariant         *value)
469
469
{
470
470
  GList *l;
 
471
 
471
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);
472
476
 
473
477
  for (l = self->priv->settings_list; l; l = l->next)
474
478
    g_settings_set_value (G_SETTINGS (l->data), key, value);
 
479
 
 
480
  g_variant_unref (value);
475
481
}
476
482
 
477
483
static GSettings *
1864
1870
  }
1865
1871
 
1866
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
}
1869
1875
 
1870
1876
static void