[PyKDE] deleting the result of sipMapCppToSelf

Jim Bublitz jbublitz at nwinternet.com
Wed Oct 31 17:53:46 GMT 2001


On 31-Oct-01 David Garcia wrote:

> I'm using  sipMapCppToSelf to convert a C++ object to a
> PyObject that will be a parameter in a PyObject_CallFunction
> call. My question is, what I should do with the returned 
> PyObject when is no longer needed? Delete it? How? 

   PyObject *obj;

   <do some stuff>

   // Delete it
   Py_DECREF (obj);

(or Py_XDECREF if obj might be NULL)

See the "Python/C API Reference Manual" Py_DECREF is in section 3

Jim




More information about the PyQt mailing list