Dear developers,
There seems to be a memory leak in the xprop tool, when using the -spy
option. Pulseaudio uses that option to know when the X session ends, as
an example. On my (long-running) X session, xprop memory usage was
steadily growing until using 1.5G...
You'll find a patch as an attachment, it's not mine and I couldn't test
it, I found it at:
http://thread.gmane.org/gmane.linux.debian.devel.pulseaudio/4456
Here is the related Debian Bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765828
Thanks for your hard work...
--- xprop.c~ 2013-08-14 16:32:43.000000000 -0600
+++ xprop.c 2014-08-06 11:51:06.490793708 -0600
@@ -95,13 +95,11 @@ Create_Thunk_List (void)
return tptr;
}
-#ifdef notused
static void
Free_Thunk_List (thunk *list)
{
free(list);
}
-#endif
static thunk *
Add_Thunk (thunk *list, thunk t)
@@ -1508,6 +1506,10 @@ Show_Prop (const char *format, const cha
thunks = Break_Down_Property(data, (int)length, type, format, size);
Display_Property(thunks, dformat, format);
+
+ Free_Thunk_List(thunks);
+ if (data)
+ XFree(data);
}
static void
@@ -1523,6 +1525,8 @@ Show_All_Props (void)
name = Format_Atom(atoms[i]);
Show_Prop(NULL, NULL, name);
}
+ if (atoms)
+ XFree(atoms);
} else
for (i = 0; i < font->n_properties; i++) {
atom = font->properties[i].name;
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel