After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 344233 - pango_layout_get_extent() with PangoFT2FontMap causes memory leaks.
pango_layout_get_extent() with PangoFT2FontMap causes memory leaks.
Status: RESOLVED DUPLICATE of bug 143542
Product: pango
Classification: Platform
Component: general
1.2.x
Other All
: Normal critical
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2006-06-08 02:45 UTC by Kouhei Sutou
Modified: 2006-06-08 03:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kouhei Sutou 2006-06-08 02:45:29 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:
Comment 1 Behdad Esfahbod 2006-06-08 03:02:52 UTC
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 ***