[Numpy-discussion] Another reference count leak: ticket #848

Charles R Harris charlesr.harris at gmail.com
Tue Jul 8 18:05:46 EDT 2008


On Tue, Jul 8, 2008 at 3:23 PM, Michael Abbott <michael at araneidae.co.uk>
wrote:

> On Tue, 8 Jul 2008, Travis E. Oliphant wrote:
> > Michael Abbott wrote:
> > > The attached patch fixes another reference count leak in the use of
> > > PyArray_DescrFromType.
> > >
> > The first part of this patch is good.  The second is not needed.
> I don't see that.  The second part of the patch addresses the case of an
> early return: this means that the DECREF that occurs later on in the code
> is bypassed, and so a reference leak will still occur if this early return
> case occurs.  Don't forget that PyArray_DescrFromType returns an
> incremented reference that has to be decremented, returned or explicitly
> assigned -- the DECREF obligation has to be met somewhere.
>

Some function calls do the DECREF on an error return. I haven't looked, but
that might be the case here.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080708/47bfb11b/attachment.html>


More information about the NumPy-Discussion mailing list