[Numpy-discussion] Another reference count leak: ticket #848
Charles R Harris
Tue Jul 8 17:05:46 CDT 2008
On Tue, Jul 8, 2008 at 3:23 PM, Michael Abbott <firstname.lastname@example.org>
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion