changeset 2380:f2edd24e9248

Fixing Memory leak I also suffer from what I believe is this bug. It was not present in geeqie 1.0 and was simple for me to reproduce in 1.2+. I open a directory containing a few thousand jpg files of around 100k each and just keep hitting the key for "Next Image". After around a minute my computer will freeze. Given this reproducibility, I ran git bisect and found the commit that introduced the behaviour for me was the following commit b4c4a924121c3aa6b2f1eb7570dd3f419d2f4d83 Author: Vladimir Nadvornik <nadvornik@suse.cz> Date: Thu Aug 2 00:15:16 2012 +0200 use cairo for drawing I then noticed what I think is a missing cairo_destroy call in cellrenderericon.c. The following patch solves the problem completely for me as far as I can tell.
author Michael Cross <mc@xi2.org>
date Fri, 19 Aug 2016 07:03:41 +0100
parents 5ddb29034ae2
children 7d4ec77aca61 9167a360c4b3
files src/cellrenderericon.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/cellrenderericon.c	Sun Jul 24 21:27:14 2016 +0100
+++ b/src/cellrenderericon.c	Fri Aug 19 07:03:41 2016 +0100
@@ -690,7 +690,11 @@
 	pixbuf = cellicon->pixbuf;
 	text = cellicon->text;
 
-	if (!pixbuf && !text) return;
+	if (!pixbuf && !text)
+		{
+		cairo_destroy(cr);
+		return;
+		}
 
 	gtk_cell_renderer_get_padding(cell, &xpad, &ypad);