Py_DECREF/Py_INCREF as Functions?

K

Kevin D. Smith

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?
 
G

Gabriel Genellina

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top