Skip to content


JimKleckner edited this page · 4 revisions
Clone this wiki locally

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 of[ constructors and destructors]. With extension types, it seems you have to free your buffers in a __dealloc__ method instead. Result? No more memory leaks.

Something went wrong with that request. Please try again.