Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Test] workaround for reported memory leaks when using MFC?
From: gast128 (gast128_at_[hidden])
Date: 2009-04-15 15:51:02


> Unfortunately, when the MFC dll gets unloaded prior to shutdown it invokes
> the CRT's memory leak detection routine which falsely reports that any
> memory allocated by the (yet to be unloaded) unit test framework has been
> leaked. Obviously, the problem here is with MFC and searching the 'net will
> yield numerous complaints on the topic.

we have the same problem with our normal app. The leak is reported due to a
destructor call of a global object. One way to tweak the reporting, is to
extend the lifetime of the global object. This can be done by explicitly
linking the main application with mfc (on vc++ 7.1: project properties,
linker, input, additional properties mfc71d.lib). Make sure to force a
relinking / rebuild after setting this.

Not sure if this helps for u.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net