Fix a memory leak around buttons in Colors prefs page.
[claws.git] / src / gtk / gtkutils.c
index f3c7aba38b89f7f0e9f1891e3d6c378f0f29e747..14fa92ec71a4357f7e65c42b1c9ad9a1c631b92d 100644 (file)
@@ -864,6 +864,7 @@ void gtkut_set_widget_bgcolor_rgb(GtkWidget *widget, guint rgbvalue)
        newstyle->bg[GTK_STATE_PRELIGHT] = gdk_color;
        newstyle->bg[GTK_STATE_ACTIVE]   = gdk_color;
        gtk_widget_set_style(widget, newstyle);
+       gtk_style_unref(newstyle);
 }
   
 /*!
@@ -1254,6 +1255,7 @@ GtkWidget *gtkut_get_link_btn(GtkWidget *window, const gchar *url, const gchar *
                style->fg[GTK_STATE_ACTIVE]   = uri_color[1];
                style->fg[GTK_STATE_PRELIGHT] = uri_color[0];
                gtk_widget_set_style(btn_label, style);
+               gtk_style_unref(style);
 #if !GTK_CHECK_VERSION(3, 0, 0)
        } else
                g_warning("color allocation failed");