Py_DECREF/Py_INCREF as Functions?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Sat Mar 31 07:16:40 CEST 2007


En Fri, 30 Mar 2007 20:21:53 -0300, Kevin D.Smith <Kevin.Smith at sas.com>  
escribió:

> I'm trying to use Python from another application that allows me to
> load functions from a DLL.  While I have most of the API working, I
> have one big problem: Py_DECREF and PyINCREF are macros which I can't
> load from the Python DLL.  Since I can't decref any objects, I'm
> leaking memory all over the place.  Is there any way to decref an
> object with a function that can be loaded from the Python DLL?

Yes. Usually the macro has an ALLCAPS name and the function a TitleCase  
name. See Py_IncRef and Py_DecRef in object.c

-- 
Gabriel Genellina




More information about the Python-list mailing list