[cairo] pyPango

Jeffrey Britton jeffb0098 at gmail.com
Wed Jan 11 10:46:55 PST 2012


There is a severe memory leak in pyPango create_layout()
I found a prior post about this on the pyGtk mailing list in July 2010 by
Cladio Cilloni.

import pango
import cairo
import pangocairo

surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 400, 300)
cr = pangocairo.CairoContext(cairo.Context(surface))
for i in xrange(500000):
    layout = cr.create_layout()
    cr.show_layout(layout)

I am running this on Windows.
I installed
pygtk-all-in-one-2.24.0.win32-py2.7.msi
cairo.version = 1.8.10
pango.version() = 12803

Does anybody know if this is a bug in the Python binding or if it is a bug
in the 'C' version of Pango or if is Windows specific?
Is there a place where I should report the bug?
Is there a different mailing list I should be posting this on?

If i move create_layout() out of the loop the problem goes away for the
most part.
Can I create the layout just once and then use the following as necessary
layout.set_text()
cr.update_layout()
cr._show_layout()




Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120111/6657d7e3/attachment.html>


More information about the cairo mailing list