[Commits] [SCM] claws branch, master, updated. 3.15.0-92-gf14f6ec

ticho at claws-mail.org ticho at claws-mail.org
Tue Jul 11 17:51:17 CEST 2017


The branch, master has been updated
       via  f14f6ecef4778d442eeb9f21a475b43c43978efa (commit)
      from  e00bcd42492ba0c7eaa909e8830832af3380ec5e (commit)

Summary of changes:
 src/gtk/gtkutils.c     |    2 ++
 src/prefs_msg_colors.c |    8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit f14f6ecef4778d442eeb9f21a475b43c43978efa
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Tue Jul 11 17:35:44 2017 +0200

    Fix a memory leak around buttons in Colors prefs page.

diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c
index f3c7aba..14fa92e 100644
--- a/src/gtk/gtkutils.c
+++ b/src/gtk/gtkutils.c
@@ -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");
diff --git a/src/prefs_msg_colors.c b/src/prefs_msg_colors.c
index 79ca383..13ba614 100644
--- a/src/prefs_msg_colors.c
+++ b/src/prefs_msg_colors.c
@@ -444,6 +444,7 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 
 		CLAWS_SET_TIP(color_buttons.custom_color[c],
 			     	     tooltip_btn_text);
+		g_free(tooltip_btn_text);
 
 		entry_custom_colorlabel[c] = gtk_entry_new();
 		gtk_widget_show (entry_custom_colorlabel[c]);
@@ -451,6 +452,7 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 				   FALSE, FALSE, 0);
 		CLAWS_SET_TIP(entry_custom_colorlabel[c],
 			     	     tooltip_entry_text);
+		g_free(tooltip_entry_text);
 	}
 
 	for (c = (COLORLABELS>>1)+(COLORLABELS&1); c < COLORLABELS; c++) {
@@ -474,6 +476,7 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 				   FALSE, FALSE, 0);
 		CLAWS_SET_TIP(color_buttons.custom_color[c],
 			     	     tooltip_btn_text);
+		g_free(tooltip_btn_text);
 
 		entry_custom_colorlabel[c] = gtk_entry_new();
 		gtk_widget_show (entry_custom_colorlabel[c]);
@@ -481,10 +484,10 @@ static void prefs_msg_colors_create_widget(PrefsPage *_page, GtkWindow *window,
 				   FALSE, FALSE, 0);
 		CLAWS_SET_TIP(entry_custom_colorlabel[c],
 			     	     tooltip_entry_text);
+
+		g_free(tooltip_entry_text);
 	}
 
-	g_free(tooltip_btn_text);
-	g_free(tooltip_entry_text);
 
 	hbox_reset_custom_colors = gtk_hbox_new(FALSE, VBOX_BORDER);
 	gtk_widget_show (hbox_reset_custom_colors);
@@ -775,6 +778,7 @@ static void set_button_bg_color(GtkWidget *widget, gint rgbvalue)
 	newstyle->bg[GTK_STATE_ACTIVE]   = color;
 
 	gtk_widget_set_style(GTK_WIDGET(widget), newstyle);
+	gtk_style_unref(newstyle);
 }
 
 static void prefs_msg_colors_save(PrefsPage *_page)

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list