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

Giles Biddison gbiddison at velocity11.com
Thu Mar 25 19:33:30 CET 2004

(apologies -- I'm not sure if top or bottom post is the norm for this
I can verify this problem.  I've been reluctant to call it a memory
leak, because it only seems to occur after calling Py_Finalize().  I did
not go so far as to attempt to use anything other than the multithreaded
runtime dll.

Giles Biddison
gbiddison at velocity11.com

-----Original Message-----
Date: Thu, 25 Mar 2004 13:53:05 GMT
From: "Paul Grenyer" <paul at paulgrenyer.co.uk>
Subject: [C++-sig] MSVC 7.1 Multithreaded Dll Memory Leak
To: c++-sig at python.org
Message-ID: <200403251353.i2PDr5d31317 at ns.cricketthosting.co.uk>
Content-Type: text/plain; charset=iso-8859-1

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()
        using namespace boost::python;
        handle<> main_module(borrowed( PyImport_AddModule
("__main__") ));


    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?


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.


C++-sig mailing list
C++-sig at python.org

End of C++-sig Digest, Vol 8, Issue 26

More information about the Cplusplus-sig mailing list