[C++-sig] boost python memoryleak

David Abrahams dave at boost-consulting.com
Tue Sep 13 13:44:59 CEST 2005


Johann Obermayr <johann.obermayr at sigmatek.at> writes:

> Hello,
>
> We have found a memory leak in the boost python.
> And we solved it with this.
>
> boost\python\converter\registrations.hpp
>
> struct BOOST_PYTHON_DECL registration
> {
> public: // member functions
>    explicit registration(type_info);
>
>    ~registration();            // <---- add this
> }
>   
> // and add this to registrations.hpp
>
> inline registration::~registration()
> {
>    delete lvalue_chain;
>    delete rvalue_chain;
> }
>
> Please can you add this for next relase.

Since Boost support is my profession, I do not accept requests for
free support at my personal email; I hope you understand.  Please post
to the appropriate mailing list
http://www.boost.org/more/mailing_lists.htm#cplussig

Boost.Python leaks many things from that point-of-view; it is not
compatible with PyFinalize.  Until that gets fixed there's no point in
trying to clean up things like this.  Also, your change doesn't
properly clean up the remainder of the chains, so it wouldn't be the
right one to make even if it were appropriate to try to fix it.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com



More information about the Cplusplus-sig mailing list