GNOME Bugzilla – Bug 344235
SVG including text causes memory leaks
Last modified: 2006-08-21 05:19:27 UTC
Please describe the problem: The following program causes memory leaks when input.svg has text: #include <librsvg/rsvg.h> int main(int argc, char **argv) { int i; if (argc < 2) { printf("usage: %s input.svg\n", argv[0]); return 1; } rsvg_init(); for (i = 0; i < 100; i++) { GdkPixbuf *pixbuf; pixbuf = rsvg_pixbuf_from_file(argv[1], NULL); if (pixbuf) g_object_unref (pixbuf); else printf("%d: NULL\n", i); g_usleep(100000); } rsvg_term(); return 0; } Steps to reproduce: 1. cc `pkg-config librsvg-2.0 --cflags --libs` -o memory-leak memory-leak.c 2. ./memory-leak SVG_including_text.svg Actual results: I can find the program causes memory leaks by viewing top result in another terminal. Expected results: No memory leaks. Does this happen every time? Yes if input.svg has text. Other information:
Created attachment 66953 [details] sample SVG including text.
Created attachment 66955 [details] [review] workaround This is caused by a Pango bug. See http://bugzilla.gnome.org/show_bug.cgi?id=143542 for more details.
This just substitutes many leaks with 1 leak. While it's an improvement, I'd rather see no leaks. To that end, I'd rather see a solution along the lines of: http://bugzilla.gnome.org/attachment.cgi?id=31799&action=view or http://bugzilla.gnome.org/attachment.cgi?id=30154&action=view
Similar approach taken to how http://bugzilla.gnome.org/attachment.cgi?id=31799&action=view did it. Thanks.
*** Bug 351763 has been marked as a duplicate of this bug. ***