[gnome-screenshot] screenshot: don't unref a floating variant



commit e7bbdeb0442e4c995e48f419d6e02663e97d4dc7
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Jan 25 14:07:29 2012 -0500

    screenshot: don't unref a floating variant
    
    g_dbus_connection_call takes the ownership of floating variants passed
    to it, so don't double unref it.

 src/gnome-screenshot.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/src/gnome-screenshot.c b/src/gnome-screenshot.c
index fd032fe..f4a565c 100644
--- a/src/gnome-screenshot.c
+++ b/src/gnome-screenshot.c
@@ -359,20 +359,18 @@ get_profile_for_window (GdkWindow *window)
   GError *error = NULL;
   guint xid;
   gchar *icc_profile = NULL;
-  GVariant *args = NULL;
   GVariant *response = NULL;
   GVariant *response_child = NULL;
   GVariantIter *iter = NULL;
 
   /* get color profile */
   xid = GDK_WINDOW_XID (window);
-  args = g_variant_new ("(u)", xid),
   response = g_dbus_connection_call_sync (connection,
                                           "org.gnome.ColorManager",
                                           "/org/gnome/ColorManager",
                                           "org.gnome.ColorManager",
                                           "GetProfileForWindow",
-                                          args,
+                                          g_variant_new ("(u)", xid),
                                           G_VARIANT_TYPE ("(s)"),
                                           G_DBUS_CALL_FLAGS_NONE,
                                           -1, NULL, &error);
@@ -391,8 +389,6 @@ get_profile_for_window (GdkWindow *window)
 out:
   if (iter != NULL)
     g_variant_iter_free (iter);
-  if (args != NULL)
-    g_variant_unref (args);
   if (response != NULL)
     g_variant_unref (response);
   return icc_profile;



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