memory leak?
- From: cen.rao@xxxxxxxxx
- Date: 27 Sep 2005 19:57:09 -0700
could somebody help me to look at the following code? I get memory leak
report, but really have no idea what is wrong. I am using visual c++
7.1 and windows XP. Thanks a lot.
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#ifdef _DEBUG
#define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)
#else
#define DEBUG_CLIENTBLOCK
#endif // _DEBUG
#ifdef _DEBUG
#define SET_CRT_DEBUG_FIELD(a) \
_CrtSetDbgFlag((a) | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))
#define CLEAR_CRT_DEBUG_FIELD(a) \
_CrtSetDbgFlag(~(a) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))
#else
#define SET_CRT_DEBUG_FIELD(a) ((void) 0)
#define CLEAR_CRT_DEBUG_FIELD(a) ((void) 0)
#endif
#ifdef _DEBUG
#define DISPLAY_REGION 1
#else
#undef DISPLAY_REGION
#endif
#include "stdafx.h"
#include <crtdbg.h>
#include <string>
int _tmain(int argc, _TCHAR* argv[])
{
using namespace std;
string test("123456789abcdefg");
_CrtMemDumpAllObjectsSince( NULL );
return 0;
}
.
- Follow-Ups:
- Re: memory leak?
- From: www.fruitfruit.com
- Re: memory leak?
- Prev by Date: Re: Problem with vector::reserve()?
- Next by Date: Re: memory leak?
- Previous by thread: debug
- Next by thread: Re: memory leak?
- Index(es):
Relevant Pages
|
|