[Commits] [SCM] claws branch, master, updated. 3.14.0-71-g6061cc3

ticho at claws-mail.org ticho at claws-mail.org
Sat Sep 10 01:34:34 CEST 2016


The branch, master has been updated
       via  6061cc33f76e265600a72923c1a2368d00f9c1d2 (commit)
      from  720b9a5429ea3ddfb5af01400eb67b9d2abac0a2 (commit)

Summary of changes:
 src/folderview.c  |   15 +++++++++++++--
 src/summaryview.c |   19 ++++++++++++++++---
 2 files changed, 29 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit 6061cc33f76e265600a72923c1a2368d00f9c1d2
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Sep 10 01:32:47 2016 +0200

    Fix a memory leak when setting summaryview and folderview fonts.

diff --git a/src/folderview.c b/src/folderview.c
index 83dc219..42c3fe0 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -2717,8 +2717,19 @@ void folderview_reflect_prefs(void)
 	last_boldfont = g_strdup(BOLD_FONT);
 	last_derive = prefs_common.derive_from_normal_font;
 
-	normal_style = normal_color_style = bold_style =
-		bold_color_style = bold_tgtfold_style = NULL;
+#define STYLE_FREE(s)			\
+	if (s != NULL) {		\
+		g_object_unref(s);	\
+		s = NULL;		\
+	}
+
+	STYLE_FREE(normal_style);
+	STYLE_FREE(normal_color_style);
+	STYLE_FREE(bold_style);
+	STYLE_FREE(bold_color_style);
+	STYLE_FREE(bold_tgtfold_style);
+
+#undef STYLE_FREE
 
 	folderview_init(folderview);
 	gtk_cmclist_freeze(GTK_CMCLIST(folderview->ctree));
diff --git a/src/summaryview.c b/src/summaryview.c
index 57511b3..bd62243 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -2881,12 +2881,25 @@ void summary_reflect_prefs(void)
 	last_boldfont = g_strdup(BOLD_FONT);
 	last_derive = prefs_common.derive_from_normal_font;
 
-	if (update_font) {	
-		bold_style = bold_marked_style = bold_deleted_style = 
-			small_style = small_marked_style = small_deleted_style = NULL;
+#define STYLE_FREE(s)			\
+	if (s != NULL) {		\
+		g_object_unref(s);	\
+		s = NULL;		\
+	}
+
+	if (update_font) {
+		STYLE_FREE(bold_style);
+		STYLE_FREE(bold_style);
+		STYLE_FREE(bold_marked_style);
+		STYLE_FREE(bold_deleted_style);
+		STYLE_FREE(small_style);
+		STYLE_FREE(small_marked_style);
+		STYLE_FREE(small_deleted_style);
 		summary_set_fonts(summaryview);
 	}
 
+#undef STYLE_FREE
+
 	summary_set_column_titles(summaryview);
 	summary_relayout(summaryview);
 	

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list