My windows program consists of
a C++(MFC) console application my.exe, which issues _CrtSetDbgFlag to see memory leaks on exit.
a C++(non-MFC) my.dll. This dll calls a 3rd party library (Oracle's OCCI C++ library).
my.exe has a deliberate leak in its main() function : new char[333];
When the program exits I see these leaks:-
Detected memory leaks! Dumping objects -> ...myExe.cpp(62) : {384} normal block at 0x0087C4B0, 333 bytes long.
However, if I call certain functions in the 3rd party library then no leaks are reported on exit. That is, I can call some occi functions from my dll, but as soon as I call the occi function to actually connect to a database (which seem to work well), then all my leak reporting disappears as if there are no leaks.
I suspect this is happening because although I am using the correct version of oracle's occi dll, this uses oracle's lower level oci.dll, which appears to use an older version of the MSVC runtime. Dependency walker shows:
MY.EXE
MSVCR100D.DLL
MY.DLL
MSVCR100D.DLL
ORAOCCI11D.DLL
MSVCR100D.DLL
OCI.DLL
MSVCR80.DLL
Thanks for any comments.