> <
oliphant@enthought.com <mailto:
oliphant@enthought.com>> wrote:
>
> Michael Abbott wrote:
> > Only half of my patch for this bug has gone into trunk, and
> without the
> > rest of my patch there remains a leak.
> >
> Thanks for your work Michael. I've been so grateful to have you and
> Chuck and others looking carefully at the code to fix its problems.
>
> In this particular case, I'm not sure I see how (the rest of) your
> patch
> fixes any remaining leak. We do seem to be having a disagreement
> about
> whether or not the reference to typecode can be pre-maturely
> destroyed,
> but this doesn't fit what I usually call a "memory leak." I think
> there may be some other cause for remaining leaks.
>
>
> Travis,
>
> There really is (at least) one reference counting error in
> PyArray_FromAny. In particular, the obj == NULL case leaves a
> reference to typecode, then exits through the first return after
> finish. In this case robj doesn't steal a reference to typecode and
> the result can be seen in the python program above or by printing out
> the typecode->ob_refcnt from the code itself. So that needs fixing. I
> would suggest a DECREF in that section and a direct return of robj.
agreed! I'll commit the change.