ports/160223: [PATCH] major memory leak in graphics/ristretto

Olivier Duchateau duchateau.olivier at gmail.com
Fri Aug 26 20:20:08 UTC 2011


>Number:         160223
>Category:       ports
>Synopsis:       [PATCH] major memory leak in graphics/ristretto
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 26 20:20:08 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Olivier Duchateau
>Release:        FreeBSD 8.2-RELEASE
>Organization:
>Environment:
>Description:
Stephan Arts, the main developer of Ristretto found memory leak in Ristretto 0.0.93.
https://bugzilla.xfce.org/show_bug.cgi?id=7882

Patch fixes this issue.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -urN /usr/ports/graphics/ristretto/Makefile graphics/ristretto/Makefile
--- /usr/ports/graphics/ristretto/Makefile	2011-03-17 14:13:14.000000000 +0100
+++ graphics/ristretto/Makefile	2011-08-26 21:13:08.000000000 +0200
@@ -7,6 +7,7 @@
 
 PORTNAME=	ristretto
 PORTVERSION=	0.0.93
+PORTREVISION=	1
 CATEGORIES=	graphics xfce
 MASTER_SITES=	${MASTER_SITE_XFCE}
 MASTER_SITE_SUBDIR=	src/apps/${PORTNAME}/${PORTVERSION:R}
diff -urN /usr/ports/graphics/ristretto/files/patch-src_image.c graphics/ristretto/files/patch-src_image.c
--- /usr/ports/graphics/ristretto/files/patch-src_image.c	1970-01-01 01:00:00.000000000 +0100
+++ graphics/ristretto/files/patch-src_image.c	2011-08-26 21:13:08.000000000 +0200
@@ -0,0 +1,46 @@
+--- src/image.c.orig	2011-02-28 19:45:44.000000000 +0100
++++ src/image.c	2011-08-26 21:08:55.000000000 +0200
+@@ -639,6 +639,7 @@
+         if(gdk_pixbuf_loader_write (image->priv->loader, (const guchar *)image->priv->buffer, read_bytes, &error) == FALSE)
+         {
+             g_input_stream_close (G_INPUT_STREAM (source_object), NULL, NULL);
++            g_object_unref (source_object);
+             g_object_unref (image);
+         }
+         else
+@@ -659,6 +660,7 @@
+         {
+             /* OK */
+             g_input_stream_close (G_INPUT_STREAM (source_object), NULL, NULL);
++            g_object_unref (source_object);
+             gdk_pixbuf_loader_close (image->priv->loader, NULL);
+             g_object_unref (image);
+         }
+@@ -666,6 +668,7 @@
+         {
+             /* I/O ERROR */
+             g_input_stream_close (G_INPUT_STREAM (source_object), NULL, NULL);
++            g_object_unref (source_object);
+             gdk_pixbuf_loader_close (image->priv->loader, NULL);
+             g_object_unref (image);
+         }
+@@ -722,6 +725,19 @@
+ cb_rstto_image_area_prepared (GdkPixbufLoader *loader, RsttoImage *image)
+ {
+     gint timeout = 0;
++
++    if (image->priv->animation)
++    {
++        g_object_unref (image->priv->animation);
++        image->priv->animation = NULL;
++    }
++
++    if (image->priv->iter)
++    {
++        g_object_unref (image->priv->iter);
++        image->priv->iter = NULL;
++    }
++
+     image->priv->animation = gdk_pixbuf_loader_get_animation (loader);
+     image->priv->iter = gdk_pixbuf_animation_get_iter (image->priv->animation, NULL);
+     if (image->priv->pixbuf)
diff -urN /usr/ports/graphics/ristretto/files/patch-src_image_list.c graphics/ristretto/files/patch-src_image_list.c
--- /usr/ports/graphics/ristretto/files/patch-src_image_list.c	1970-01-01 01:00:00.000000000 +0100
+++ graphics/ristretto/files/patch-src_image_list.c	2011-08-26 21:13:08.000000000 +0200
@@ -0,0 +1,10 @@
+--- src/image_list.c.orig	2011-02-28 20:52:54.000000000 +0100
++++ src/image_list.c	2011-08-26 21:03:07.000000000 +0200
+@@ -269,6 +269,7 @@
+                 if (rstto_image_list_iter_get_image (iter->data) == image)
+                 {
+                     ((RsttoImageListIter *)(iter->data))->priv->image = NULL;
++                    g_signal_emit (G_OBJECT (iter->data), rstto_image_list_iter_signals[RSTTO_IMAGE_LIST_ITER_SIGNAL_CHANGED], 0, NULL);
+                 }
+             }
+             iter = g_slist_next (iter);


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list