Re: strange memory leak problem
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Thu, 30 Aug 2007 00:01:36 -0400
This string will be freed when the variable leaves scope. What is the evidence that this
is leaking memory (if you're relying on CrtMemCheckPoint, know that it doesn't work. See
my essay on this problem on my MVP Tips site).
joe
On Thu, 30 Aug 2007 03:21:09 -0000, mdk <leun98@xxxxxxxxx> wrote:
Hi all,Joseph M. Newcomer [MVP]
I use _CrtSetBreakAlloc to break the code at the point the leaking
memory is allocated and find that it is a CString allocated locally
within a function.
void Myclass::PrintInfo(CString &strTmp)
{
......
CString strUser( "bah");
strTmp.Format(IDS_START_INFO, strUser,);
.....
}
Additionally I have found some other memory leaks occur in STL stream
API calls, like << >>.
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: strange memory leak problem
- From: Giovanni Dicanio
- Re: strange memory leak problem
- References:
- strange memory leak problem
- From: mdk
- strange memory leak problem
- Prev by Date: strange memory leak problem
- Next by Date: Re: something more about GetTextExtentExPoint
- Previous by thread: strange memory leak problem
- Next by thread: Re: strange memory leak problem
- Index(es):
Relevant Pages
|