[gnome-settings-daemon] wacom: unref the variants we get with g_settings_get_value()



commit 152a5c4e5d6a1394457bcb0a8268f35debd600a4
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Jan 26 15:42:21 2012 -0500

    wacom: unref the variants we get with g_settings_get_value()
    
    Just let the set_* functions that take a GVariant also unref it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=668776

 plugins/wacom/gsd-wacom-manager.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index f2c662c..99b3d12 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -173,6 +173,7 @@ set_pressurecurve (GsdWacomDevice *device,
         gsize nvalues;
 
         property.data.i = g_variant_get_fixed_array (value, &nvalues, sizeof (gint32));
+        g_variant_unref (value);
 
         if (nvalues != 4) {
                 g_error ("Pressurecurve requires 4 values.");
@@ -198,6 +199,7 @@ set_area (GsdWacomDevice  *device,
         gsize nvalues;
 
         property.data.i = g_variant_get_fixed_array (value, &nvalues, sizeof (gint32));
+        g_variant_unref (value);
 
         if (nvalues != 4) {
                 g_error ("Area configuration requires 4 values.");
@@ -224,6 +226,8 @@ set_display (GsdWacomDevice  *device,
         property.data.i = (gint*)(&matrix);
         g_debug ("Applying matrix to device...");
         wacom_set_property (device, &property);
+
+        g_variant_unref (value);
 }
 
 static void
@@ -256,6 +260,7 @@ set_device_buttonmap (GsdWacomDevice *device,
 	intmap = g_variant_get_fixed_array (value, &nmap, sizeof (gint32));
 	for (i = 0; i < nmap && i < sizeof (map); i++)
 		map[i] = intmap[i];
+        g_variant_unref (value);
 
 	gdk_error_trap_push ();
 
@@ -375,7 +380,6 @@ set_wacom_settings (GsdWacomManager *manager,
 
 		variant = g_variant_new_array (G_VARIANT_TYPE_INT32, values, G_N_ELEMENTS (values));
 		set_area (device, variant);
-		g_variant_unref (variant);
 		return;
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]