summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorTomas Bzatek <[email protected]>2020-07-20 17:36:45 +0200
committerLuke from DC <[email protected]>2020-07-29 20:47:20 +0000
commit9768370328828ab8cc32f828fac3f34661bcca9c (patch)
tree431573281331bed144fc6279cd00cce65c0de7d4 /applets
parent35bd00e59e3aeedd61da46ec961e06623900359c (diff)
downloadmate-panel-9768370328828ab8cc32f828fac3f34661bcca9c.tar.bz2
mate-panel-9768370328828ab8cc32f828fac3f34661bcca9c.tar.xz
workspace-switcher: Fix leaking color string
Diffstat (limited to 'applets')
-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),