I will continue my monologue  :-)
The obvious solution to this problem is to use a release built version of log4cxx, and if you want to be able to debug log4cxx, you could "Use MFC in a static library".

Björn Carlsson wrote:
Now I found an answer to this, on unloading mfc-dll memory leaks are checked too soon...
"static class members which are destroyed after the leak dump is displayed"


Björn Carlsson wrote:
I continued to test, and made a similar application in VS6, and I also built log4cxx using VS6.
I added:
     BasicConfigurator::configure();
     LOG4CXX_INFO(logger, "Entering application.");
in the application constructor, also in this case a get a massive memory leak is detected on application exit?? Anybody else who's got this problem? Time to file a bug report?

Björn Carlsson wrote:
I use the CVS HEAD version.
I have been struggling for some time with a memory leak caused by log4cxx. If I make a very simple MFC Application (for example wizard generated, dialog based) using VS.NET 2003.  I add log4cxxd.lib as an additional dependencie.
If I then add for example
LoggerPtr BELogger = Logger::getRootLogger();
then I get a massive memory leak.
The application does nothing. Have I missed something?

the only code I added to the wizard generated application was:
#include <log4cxx/logger.h>
using namespace log4cxx;
LoggerPtr BELogger = Logger::getRootLogger();
I could change the getRootLogger call to some other log4cxx call and get the same result.
Do I need some cleanup code?
Log4cxx was build using ant and VS.NET 2003-vsvars.bat, with no parameters, so it should be shared debug...
And the testapp was a none unicode debug configuration.

--


/Björn Carlsson
VersionSupport.com

Reply via email to