On Wed, Dec 15, 1999 at 01:07:30PM -0500, John Ehresman wrote:
>
> Attached is a patch that fixes several reference leaks in gtkmodule.c that
> was made against the version released is pygtk-0.6.3. The problems it
> fixes are:
> * When a widget is created but is not added to a container, it was never
> released since gtk_object_sink was never called. I fixed this by
> calling gtk_object_sink in PyGtk_New, which isn't ideal, but a change
> in how constructor functions are generated would be required to avoid
> this.
You're right. Floating GtkObjects should never exist in PyGTK. After
creating the GtkObject, ref and sink.
> * PyList_Append does not consume the reference of the element being
> appended. I inserted Py_DECREF in the aappropiate places.
> * Py_BuildValue also does not consume references that are passed to it.
> Since this is used to build the tuples that are attached to the signal
> handlers, the callback function objects were never released. I fixed
> the signal connection functions, but did not fix other uses of
> Py_BuildValue.
I rewrote the rest of your patch to fix leaked PyObjects all over the
place.
Matt
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]