Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been getting a problem with a memory leak, and using the method of debugging the source of the problem was stated as in mfcm.cpp at line 29. The code sets up the load of the mfcm80DLL Dynamic Link Library via:

new CDynLinkLibrary(mfcm80DLL);

however there does not seem to be an associated FreeLibrary in the Code.

I am using this library to use the System namespace for various bits of data that I require.
How do I get round the memory leak problem, when the potential source is the mfc code?
Posted

1 solution

This[^] looks like an explanation of the problem. Apparently if you use DLLs linked with different versions of the MFC DLL and is harmless.

A couple of things to consider... Not all memory leaks are worth tracking down. Compilers for example often use a slash and burn approach to dynamic memory - they allocate it and never bother releasing it. The real problem in C++ is not necessarily the memory leaking it's that the destructor doesn't get called.

And whatever you do, in your code never write new T; without immediately assigning the result to a smart pointer of some sort. Then you'll never leak memory and all your destructors will be called.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900