summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <[email protected]>2020-07-20 17:36:45 +0200
committerPablo Barciela <[email protected]>2020-08-03 13:46:34 +0200
commit0119f31e89fea9a5d701a732685fe09f61500eb8 (patch)
treebacc82b06e11c74209ffd9ddcd79bc83a45c19f5
parent0d802f43b13a8bbb2bd3f11a3d1314ff693f740f (diff)
downloadmate-panel-0119f31e89fea9a5d701a732685fe09f61500eb8.tar.bz2
mate-panel-0119f31e89fea9a5d701a732685fe09f61500eb8.tar.xz
workspace-switcher: Fix leaking color string
-rw-r--r--applets/wncklet/workspace-switcher.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/applets/wncklet/workspace-switcher.c b/applets/wncklet/workspace-switcher.c
index 0e59dc00..4d74856b 100644
--- a/applets/wncklet/workspace-switcher.c
+++ b/applets/wncklet/workspace-switcher.c
@@ -256,16 +256,20 @@ static void applet_style_updated (MatePanelApplet *applet, GtkStyleContext *cont
{
GtkCssProvider *provider;
GdkRGBA color;
+ gchar *color_str;
+ gchar *bg_css;
provider = gtk_css_provider_new ();
/* Provide a fallback color for the highlighted workspace based on the current theme */
gtk_style_context_lookup_color (context, "theme_selected_bg_color", &color);
- gchar *bg_css = g_strconcat (".wnck-pager:selected {\n"
- " background-color:", gdk_rgba_to_string (&color), ";\n"
- "}", NULL);
+ color_str = gdk_rgba_to_string (&color);
+ bg_css = g_strconcat (".wnck-pager:selected {\n"
+ " background-color:", color_str, ";\n"
+ "}", NULL);
gtk_css_provider_load_from_data (provider, bg_css, -1, NULL);
g_free (bg_css);
+ g_free (color_str);
gtk_style_context_add_provider (context,
GTK_STYLE_PROVIDER (provider),