! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Memory leak when using SVG icons.
Status:
RESOLVED: FIXED
Product:
Xfce4-trigger-launcher
Component:
General

Comments

Description Daniel James 2004-11-26 13:29:36 CET
A stream created using popen must be closed using pclose, trigger launcher
currently uses fclose. This causes a memory leak. Here's a patch:

Index: panel-plugin/triggerlauncher.c
===================================================================
RCS file:
/cvsroot/xfce/xfce4/xfce4-trigger-launcher/panel-plugin/triggerlauncher.c,v
retrieving revision 1.14
diff -r1.14 triggerlauncher.c
219c219
<               fclose(file);
---
>               pclose(file);
Comment 1 Daniel James 2004-11-26 23:22:58 CET
Created attachment 111 
Program to demonstrate GDK's SVG memory leak.

Oh dear, this is the second 'bug' I've reported in xfce4, and like the first it
turned out not to be an xfce4 bug at all. I'm very sorry.

When I tested my 'fixed' version, I didn't set the icons on trigger launcher to
the ones I was using, when I did the leak came back. It seems it only happens
when I use an SVG file for the icon.

So I wrote a silly little program to test this (attached). Run it with an svg
and it consumes all your memory, run with it a png and it just consumes all
your processor cycles.

It might be worth changing the plugin to store the two icons rather than
fetching them each time - but I guess it's probably to near to release to do
that.

But the pclose comment still holds - but it's just a minor quibble now.
Comment 2 Benedikt Meurer editbugs 2004-11-26 23:27:58 CET
pclose Bug fixed, thanks.
Comment 3 Jasper Huijsmans editbugs 2004-11-30 19:05:13 CET
Fixed, according to comments.
Comment 4 Daniel James 2004-11-30 22:44:12 CET
Created attachment 115 
Reduce effect of memory leak

I know this isn't your bug, but I've been using this patch to reduce the effect
of the memory leak - with it, it only leaks when you change the options,
instead of every time the script is run (which can really build up and use up
all of your computer's memory). Whether you want to use it or not is up to you.
You might want to suggest that users don't use SVG icons with the trigger
launcher.

Bug #545

Reported by:
Daniel James
Reported on: 2004-11-26
Last modified on: 2009-07-15

People

CC List:
0 users

Version

Version:
unspecified

Attachments

Program to demonstrate GDK's SVG memory leak. (370 bytes, text/plain)
2004-11-26 23:22 CET , Daniel James
no flags
Reduce effect of memory leak (2.62 KB, patch)
2004-11-30 22:44 CET , Daniel James
no flags

Additional information