[Xfce4-commits] [panel-plugins/xfce4-wavelan-plugin] 01/02: Use a temporary variable for color_str so that it can be freed

noreply at xfce.org noreply at xfce.org
Wed Dec 28 22:04:56 CET 2016


This is an automated email from the git hooks/post-receive script.

landry pushed a commit to branch master
in repository panel-plugins/xfce4-wavelan-plugin.

commit 42f8b168facd4e6652c03ea0ba38eeb279b3eb6f
Author: Landry Breuil <landry at xfce.org>
Date:   Wed Dec 28 22:03:51 2016 +0100

    Use a temporary variable for color_str so that it can be freed
---
 panel-plugin/wavelan.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/wavelan.c b/panel-plugin/wavelan.c
index b85d68d..e708dc2 100644
--- a/panel-plugin/wavelan.c
+++ b/panel-plugin/wavelan.c
@@ -78,7 +78,7 @@ wavelan_set_state(t_wavelan *wavelan, gint state)
   GdkRGBA color;
 #if GTK_CHECK_VERSION (3, 16, 0)
   GtkCssProvider *css_provider;
-  gchar *css;
+  gchar *css, *color_str;
 #if GTK_CHECK_VERSION (3, 20, 0)
   gchar * cssminsizes = "min-width: 4px; min-height: 0px";
   if(gtk_orientable_get_orientation(GTK_ORIENTABLE(wavelan->signal)) == GTK_ORIENTATION_HORIZONTAL)
@@ -116,6 +116,7 @@ wavelan_set_state(t_wavelan *wavelan, gint state)
     gdk_rgba_parse(&color, signal_color_bad);
 
 #if GTK_CHECK_VERSION (3, 16, 0)
+     color_str = gdk_rgba_to_string(&color);
 #if GTK_CHECK_VERSION (3, 20, 0)
      css = g_strdup_printf("progressbar trough { %s } \
                             progressbar progress { %s ; background-color: %s; background-image: none; }",
@@ -123,7 +124,8 @@ wavelan_set_state(t_wavelan *wavelan, gint state)
 #else
      css = g_strdup_printf(".progressbar { background-color: %s; background-image: none; }",
 #endif
-                           gdk_rgba_to_string(&color));
+                           color_str);
+     g_free(color_str);
 #else
      gtk_widget_override_background_color(GTK_WIDGET(wavelan->signal),
                              GTK_STATE_PRELIGHT,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list