
Tanguy Fautre <tanguy.fautre@spaceapplications.com> writes:
I've been assessing and learning boost.python (1.33.1). But when I add memory leak detection to a small test program (cf. attachment), I found tons of memory leaks (about 20 leaks).
Even when the core of the program is only:
try { Py_Initialize(); object main_module = object( handle<>(borrowed(PyImport_AddModule("__main__"))) ); }
catch (const error_already_set &) { PyErr_Print(); }
Py_Finalize();
it is still finding some memory leaks.
Am I doing something wrong? Or is this a bug in boost.python?
Py_Finalize isn't supported by Boost.Python, as http://www.boost.org/libs/python/todo.html#pyfinalize-safety explains. That should also explain the "leaks" you are seeing. -- Dave Abrahams Boost Consulting www.boost-consulting.com