Memory leak when using a C++ module for Python

Jaume Bonet jaume.bonet at gmail.com
Tue Dec 16 20:04:01 CET 2008


When I tried the C++ function with a C++ main() (skipping the Python
part) it didn't show any memory problem, but I'll re-check it anyway,
thanks...

On Dec 16, 9:16 am, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
wrote:
> En Thu, 11 Dec 2008 15:35:58 -0200, Jaume Bonet <jaume.bo... at gmail.com>  
> escribió:
>
> > This is the function that is visible from python and the one that the
> > python code calls:
>
> > static PyObject * IMFind (PyObject *self, PyObject *args, PyObject
> > *kwargs) {
>
> Your function does not call any Python function except  
> PyArg_ParseTupleAndKeywords (which does not modify reference counts).
> So it's unlikely that this could cause any memory leak. I'd revise how  
> memory is allocated and deallocated on the C++ side.
>
> --
> Gabriel Genellina




More information about the Python-list mailing list