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

Leo Yee surffirst at yahoo.com
Wed Dec 24 14:23:03 CET 2003


Ralf W. Grosse-Kunstleve <rwgk at yahoo.com> writes:

>>Have you tried it the "normal" way, i.e. Py_Initialize() first and then
>>PyImport_ImportModule()? And without calling Py_Finalize()?

I compiled the code to DLLs and import it from a python script but the
memory leaks were still there.

I guess if we put the following at the beginning of a program we will always
get these memory leaks.

int _tmain(int argc, _TCHAR* argv[])
{
    _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
...

"David Abrahams" <dave at boost-consulting.com> writes:
> I doubt you can do anything about it without solving the problem
> described above.  Those references are keeping memory from being
> deallocated.

I guess you mean that's not a problem and the memory leaks wouldn't made my
programs mal-functional.

Merry Chiristmas.

Leo Yee







More information about the Cplusplus-sig mailing list