[C++-sig] Re: boost: python may cause memory leaks?

David Abrahams dave at boost-consulting.com
Wed Dec 24 14:03:16 CET 2003

"Leo Yee" <surffirst at yahoo.com> writes:

> You are right. This seems caused by using
>  if (PyImport_AppendInittab("hello", inithello) == -1)
>         return 1;
> before
>     Py_Initialize();

That's not the problem.  The problem is that Boost.Python hangs on to
some Python references even after Py_Finalize is called.  When the
application exits, those reference counts are decremented, even
though there's no interpreter running.

> However, I can't find a solution to this problem. There is no
> documentation telling me how to remove these memeory leaks.

I doubt you can do anything about it without solving the problem
described above.  Those references are keeping memory from being

Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list