I've been writing a wrapper for the Mjpegtools yuv4mpeg API, which contains several extension classes. Even though I provided a del method which free()s all malloc()ed buffers, memory was leaking like a firehose. I realised the del methods were not being invoked.
But deeper within the Pyrex documentation is a little mention ofconstructors and destructors. With extension types, it seems you have to free your buffers in a dealloc method instead. Result? No more memory leaks.
