Hi all,
I just fix a bug of pango_cairo_create_layout that cause memory leak
(very bad), below is patch detail:
---------------------------------- patch start ----------------------------
Index: pygtk-2.24.0/pangocairo.override
===================================================================
--- pygtk-2.24.0.orig/pangocairo.override 2012-04-14
01:40:59.568703232 +0800
+++ pygtk-2.24.0/pangocairo.override 2012-04-14 01:41:05.792703324 +0800
@@ -119,10 +119,15 @@
_wrap_pango_cairo_create_layout(PyGObject *self)
{
PangoLayout *ret;
+ PyObject *py_ret;
ret = pango_cairo_create_layout(PycairoContext_GET(self));
/* pygobject_new handles NULL checking */
- return pygobject_new((GObject *)ret);
+ py_ret = pygobject_new((GObject *) ret);
+ if (ret) {
+ g_object_unref(ret);
+ }
+ return py_ret;
}
static PyObject *
---------------------------------- patch end -----------------------------
Please apply this patch, thanks!
-- Andy
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/