Memory Leak
1 messages in this thread
I have a problem with a memory leak that seems to
be originating in the foundation classes. I am using MFC 2.0
that comes with VC++ 1.0. From what I can tell the temporary
objects allocated by the CDC::FromHandle and CGdiObject::FromHandle
functions are not being deleted. In the MFC source code memory
tracking is turned off when these allocations are made so the
objects cannot be seen with CMemoryState::DumpAllObjectsSince.
I documented out the line that turns memory checking off and
rebuilt everything and then after running the program for a
significant period of time I performed a dump via DumpAllObjectsSince
and dozens of CDC and CGdiObject objects were still in memory.
Also, I know that the leak does not originate in my code because
i've created a new project with appwizard and ran it without adding
any additional code and it has the same memory leak. I am using
the static libraries, not a DLL, does anyone know what could
cause this? I haven't tampered with the source code of MFC at
all until now. I know that the temporary objects are supposed to
be deleted in the CWinApp::OnIdle function, but after this function gets called
the temporary objects are still in memory. Any help would
be greatly appreciated.
– Dave