[PyKDE] Another little big (I think...) (or was that bug?)

Toby Sargeant Toby.Sargeant at fulcrum.com.au
Tue Dec 7 13:56:02 GMT 1999


On Mon, Dec 06, 1999 at 06:31:22PM +1100, Toby Sargeant wrote:
> In sipGetThis, there is the code fragment:
> 
>         if (thisObj != NULL)
>         {
>                 // sipParseArgs() will decrement the reference count.
> 
>                 Py_INCREF(arg);
>                 return (sipThisType *)thisObj;
>         }
> 
> The comment appears not to be true, and the arg tuple passed to sipParseArgs
> never gets gc'ed as a result of the incref. commenting it out fixed the
> problem.
> 
> Toby.

Obviously this wasn't the answer... There _is_ a corresponding Py_DECREF in
sipParseArgs(), it's just not called in a couple of cases (namely
qt.QListView.ensureItemVisible and friends). The corresponding code gencode.c
that emits the signature used in sipParseArgs() seems to be backwards with
respect to sipParseArgs though. "-" in gencode.c means no decref (according
to the variable name) but means decref in sipParseArgs.

I'm really not sure what's meant to be going on here; as far as I can see,
there's no reason to play around with the refcount of the argument tuple.

Toby.





More information about the PyQt mailing list