Brian Graversen <[EMAIL PROTECTED]> writes: > [...] All memory allocated locally using malloc will have to be > free'd in C before returning, and then the return value is build > using the python supplied function. It makes sure that refcount is > incremented, and python then free's that python object when the last > reference goes away, so all is well as I see it.
Yes, I'm pretty sure that works with no leaks. About cleaning up memory, then it's only because you return a built-in Python type that you have to free all allocated memory -- if we instead made our own Python type, we could use the tp_dealloc member to free the memory. I found a description of this here: http://docs.python.org/ext/node27.html http://docs.python.org/ext/node22.html -- Martin Geisler _______________________________________________ viff-devel mailing list (http://viff.dk/) firstname.lastname@example.org http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk