GNOME Bugzilla – Bug 344233
pango_layout_get_extent() with PangoFT2FontMap causes memory leaks.
Last modified: 2006-06-08 03:02:52 UTC
Please describe the problem: The following program causes memory leaks: #include <pango/pango.h> #include <pango/pangoft2.h> int main(int argc, char **argv) { int i; gboolean get_extents; g_type_init(); get_extents = argc < 2; for (i = 0; i < 100; i++) { PangoFT2FontMap *fontmap; PangoContext *context; PangoLayout *layout; fontmap = PANGO_FT2_FONT_MAP (pango_ft2_font_map_new ()); context = pango_ft2_font_map_create_context (fontmap); g_object_unref (fontmap); layout = pango_layout_new (context); g_object_unref (context); if (get_extents) pango_layout_get_extents (layout, NULL, NULL); g_object_unref (layout); usleep (100000); } return 0; } Steps to reproduce: 1. cc `pkg-config pangoft2 --cflags --libs` -o memory-leak memory-leak.c 2. ./memory-leak Actual results: I can find the program causes memory leaks by viewing top result in another terminal. Expected results: `./memry-leak no-leak' doesn't cause memory leaks. I hope `./memory-leak' have the same work of `./memory-leak no-leak'. Does this happen every time? Yes. Other information:
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 143542 ***