[Commits] [SCM] claws branch, master, updated. 3.17.0-182-g906eff2

ticho at claws-mail.org ticho at claws-mail.org
Wed Nov 28 22:34:47 CET 2018


The branch, master has been updated
       via  906eff23421e97c7e154ea998bc4b2d74de930ca (commit)
      from  0f9a9f5997392e108fb8341975cd54035536655e (commit)

Summary of changes:
 src/folderview.c |    5 +++++
 1 file changed, 5 insertions(+)


- Log -----------------------------------------------------------------
commit 906eff23421e97c7e154ea998bc4b2d74de930ca
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed Nov 28 22:33:23 2018 +0100

    Fix a memory leak in folderview_update_node().

diff --git a/src/folderview.c b/src/folderview.c
index 2679320..1f8ee97 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -1519,6 +1519,7 @@ static void folderview_update_node(FolderView *folderview, GtkCMCTreeNode *node)
 	gboolean use_bold, use_color;
 	gint *col_pos = folderview->col_pos;
 	SpecialFolderItemType stype;
+	gboolean copiedstyle = FALSE;
 	
 	item = gtk_cmctree_node_get_row_data(ctree, node);
 	cm_return_if_fail(item != NULL);
@@ -1728,6 +1729,7 @@ static void folderview_update_node(FolderView *folderview, GtkCMCTreeNode *node)
 		if (item->prefs->color > 0 && !use_color) {
 			gtkut_convert_int_to_gdk_color(item->prefs->color, &gdk_color);
 			color_style = gtk_style_copy(bold_style);
+			copiedstyle = TRUE;
 			color_style->text[GTK_STATE_NORMAL] = gdk_color;
 			style = color_style;
 		} else if (use_color) {
@@ -1747,6 +1749,7 @@ static void folderview_update_node(FolderView *folderview, GtkCMCTreeNode *node)
 		GdkColor gdk_color;
 		gtkut_convert_int_to_gdk_color(item->prefs->color, &gdk_color);
 		color_style = gtk_style_copy(normal_style);
+		copiedstyle = TRUE;
 		color_style->text[GTK_STATE_NORMAL] = gdk_color;
 		style = color_style;
 	} else {
@@ -1754,6 +1757,8 @@ static void folderview_update_node(FolderView *folderview, GtkCMCTreeNode *node)
 	}
 
 	gtk_cmctree_node_set_row_style(ctree, node, style);
+	if (copiedstyle)
+		g_object_unref(style);
 
 	if ((node = gtkut_ctree_find_collapsed_parent(ctree, node)) != NULL)
 		folderview_update_node(folderview, node);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list