Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

owl

ATL - Default memory leak

This topic is 5628 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement

#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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!