[C++-sig] MSVC 7.1 Multithreaded Dll Memory Leak

Paul Grenyer paul at paulgrenyer.co.uk
Thu Mar 25 14:53:05 CET 2004


Hi All

I've had a look at the FAQ and used google to look through the archives 
but I can't find anything about this problem or anything similar to it.

My basic problem is that when I use the Multithreaded Dll (both Debug 
and Release) runtime with boost python I get a memory leak. Even with 
the simplest of code. For example:

#include <boost/python.hpp>
#include <iostream>
#include <cstdlib>
#include <FindMemoryLeaks.h>

int main()
{
    Py_Initialize();
	
    {
        using namespace boost::python;
        handle<> main_module(borrowed( PyImport_AddModule
("__main__") ));
    }

    Py_Finalize();

    return EXIT_SUCCESS;
}

If I use the single threaded runtime or the multithreaded static 
runtime there is no memory leak.

I've checked and rebuilt boost python to ensure that it is built with 
the multithreaded dll runtime, but that didn't solve the problem. 
Therefore I suspect that the problem is with the python23.dll and the 
corresponding library?

Has anyone else come across this?

Regards
Paul

Paul Grenyer
Email: paul at paulgrenyer.co.uk
Web: http://www.paulgrenyer.co.uk

Have you met Aeryn: http://www.paulgrenyer.co.uk/aeryn/?
Version 0.3.0 beta now available for download.






More information about the Cplusplus-sig mailing list