const string leaks?
- From: "Bonj" <a@xxxxx>
- Date: Sun, 24 Apr 2005 18:41:03 +0100
Hello
This is a question about memory leaks, well two actually - one relating to
what memory leak function to use and the other about whether static const
std::strings leak.
Firstly I used the following type code to test for memory leaks:
int main()
{
int retval = 0;
{
//...app's code
}
_CrtDumpMemoryLeaks();
return retval;
}
and it appeared to dump loads of blocks, the data in some I recognised as
the SQL strings I had stored in some std::string members that were static
const members of a class. My question is, does _CrtDumpMemoryLeaks just
identify these as leaks because being static const, they don't go out of
scope till the app ends and thus don't release their memory before _CDML is
called (and if so is there any debugging trick to make them?) - *or*, does a
static const std::string actually have known leaks?
Secondly, what is the difference between using this function and the MFC
CMemoryState object, with its Checkpoint and DumpAllObjectsSince methods,
and which is better and for what reason?
Thanks for any insight!
.
- Follow-Ups:
- Re: const string leaks?
- From: Bonj
- Re: const string leaks?
- From: Doug Harrison [MVP]
- Re: const string leaks?
- From: Carl Daniel [VC++ MVP]
- Re: const string leaks?
- Prev by Date: Re: Getting result of odbc's INSERT INTO command
- Next by Date: Re: const string leaks?
- Previous by thread: Printer Connected? Help
- Next by thread: Re: const string leaks?
- Index(es):
Relevant Pages
|