2009/4/20 "V. Armando Solé" <s...@esrf.fr>: > Dan S wrote: >> But as you can see, my C code doesn't perform any malloc() or >> suchlike, so I'm stumped. >> >> I'd be grateful for any further thoughts > Could it be your memory leak is in: > > return PyFloat_FromDouble(3.1415927); // temporary > > > You are creating a "python float object" from something. What if you > return Py_None instead of your float?: > > Py_INCREF(Py_None); > return PyNone; > > I do not know if it will help you but I guess it falls in the "any > further thought" category :-)
Thanks :) but that doesn't alter things. In fact: I found the real source of the problem. Namely: I was doing #include "Numeric/arrayobject.h" when I should have been doing #include "numpy/arrayobject.h" Therefore I was compiling against the old deprecated version of the lib, which presumably had a memory leak inside itself which got fixed in the intervening years. Using the up-to-date lib, no leak. Thanks all, anyway! Dan _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion