N/APosted on - 12/05/2011
I have received a Microsoft Foundation Class (MFC) dialogue application. It is determine as a title called CMyDialog from CAxDialogImpl. I make some object and called DoModal CMyDialog, and install the application. However, I believed that the memory was leaking and I notice that the memory allocated by HeapAlloc was not released. Where is the freedom? Please help me.
Memory Leak in Microsoft Foundation Class
The possible cause of the memory is as a result of you having allocated the memory on the heap and thereafter you never deallocated that memory so as it can reused later on, or you end up using a memory that has already been allocated. The problem occurs for programs that have been set to run a certain period of time only. When the program has been to run for a long period of time, then a very small leak will automatically compound itself, and then all the memory resources will be exhausted leading to the program to crash. The memory leaks can be very hard to detect sometimes. With MFC, you can detect the leaks during the development stage.