There is a severe memory leak in pyPango create_layout()<br>I found a prior post about this on the pyGtk mailing list in July 2010 by Cladio Cilloni.<br><br>import pango<br>import cairo<br>import pangocairo<br><br>surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 400, 300)<br>
cr = pangocairo.CairoContext(cairo.Context(surface))<br>for i in xrange(500000):<br>    layout = cr.create_layout()<br>    cr.show_layout(layout) <br><br>I am running this on Windows.<br>I installed <br>pygtk-all-in-one-2.24.0.win32-py2.7.msi<br>
cairo.version = 1.8.10<br>pango.version() = 12803<br><br>Does anybody know if this is a bug in the Python binding or if it is a bug in the &#39;C&#39; version of Pango or if is Windows specific?<br>Is there a place where I should report the bug?<br>
Is there a different mailing list I should be posting this on?<br><br>If i move create_layout() out of the loop the problem goes away for the most part.<br>Can I create the layout just once and then use the following as necessary<br>
layout.set_text()<br>cr.update_layout()<br>cr._show_layout()<br><br><br><br><br>Thanks.<br><br><br>