[PyKDE] Re: Patch for libsip [was: reference counting and signals&slots]

Heinrich Kuettler ql.heiner at web.de
Sun Nov 11 09:23:14 GMT 2001

On Saturday 10 November 2001 05:13, Andreas Gerstlauer wrote:
> Hi!
> > there is a feature in sip I don't understand. I connected a python
> > signal to  a python slot. And when I emit the signal with an argument
> > (that is, the  right number of args for this "slot"), the argument's
> > ref-count gets  increased. This code is meant to illustrate this:
> > [...]
> I ran into the same problem here. That bug basically creates memory
> leaks for everything that is passed through a slot.
> > I think there is an unmatched Py_INCREF in sipEmitToSlot. At least in
> > case  PyEval_CallObject (qtlib.cpp:300) succeeds the first time it is
> > called. I  might be wrong, thought.
> Nope, you are right, that seems to be a problem. I have created a patch
> to fix it, see attachement. Note however, that I am not completely
> sure whether I did the right thing... Seems to work here, though.

Works here too, thanks!


More information about the PyQt mailing list