An instance of a derived director class in python will not be deleted when such an instance goes out of scope, when using vtable. This is because the method object returned by PyObject_GetAttr (in swig_get_method() in the generated wrapper code) and which is stored in the vtable holds a reference to the actual instance. When many such objects are instantiated and supposedly destroyed, it creates quite huge memory leaks.
Please consider the following minimal example that reproduce the leak
(Need to be run on linux/unix system to be able to print memory usage...)
Log in to post a comment.