ATL - Default memory leak
Does ATL come with a predefined memory leak?
I created a default ATL project and added a default "ATL Control Class" to it (Windowed Only). I added the folowing handles but with no code on any of them:
MESSAGE_HANDLER(WM_SIZE, OnSize)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_DESTROY,OnDestroy)
MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
Then I made a simple visual basic EXE project to test it (which has only one form, the ATL control and the default vb controls).
Every time I run this vb EXE and close it I notice that my allocated memory has increased about 300k+.
Is this normal? Is there any fix for this? Is it me? Does God exist?
#define _CRTDBG_MAP_ALLOC#include <memory.h>#include <malloc.h>#include <crtdbg.h>
in your atl project.
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)|_CRTDBG_LEAK_CHECK_DF);
at the beginning of winmain.
watch debug output when you quit the program; if you have any memory leaks, you''ll be told about them.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement