Memory leakage and the stack?
From: Tim (Tim_at_discussions.microsoft.com)
Date: 07/14/04
- Next message: Ram Kumar: "Re: Embed an exe inside an ActiveX control ?"
- Previous message: Bo Persson: "Re: Problem in compiling a VC++ Studio Project on VC++.Net Plateform."
- Next in thread: Carl Daniel [VC++ MVP]: "Re: Memory leakage and the stack?"
- Reply: Carl Daniel [VC++ MVP]: "Re: Memory leakage and the stack?"
- Reply: Tim: "RE: Memory leakage and the stack?"
- Reply: Ilian Iliev: "Re: Memory leakage and the stack?"
- Reply: Dead RAM: "Re: Memory leakage and the stack?"
- Reply: anonymous_at_discussions.microsoft.com: "Memory leakage and the stack?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Jul 2004 05:58:02 -0700
I'm using Visual C++ 6.0 and the debugger is reporting memory leaks. I go to the line it references and it is within one of my methods. The line it points to is:
rect = new CRect(0, 0, vidWidth,vidHeight);
At the very start of the method I have:
CRect rect;
I was thinking rect would be automatically deallocated on method exit. Do I have to deallocate the memory rect is pointing to? When I try either delete rect; or delete [] rect; at runtime I get a 'user breakpoint encountered' dialog box, but I set no breakpoints at the line where I delete the rect variable.
So should the memory rect points to be automatically deallocated upon method exit, and if not then why can't I delete it with the delete [] rect or delete rect statements?
Thanks!
[Tim]
- Next message: Ram Kumar: "Re: Embed an exe inside an ActiveX control ?"
- Previous message: Bo Persson: "Re: Problem in compiling a VC++ Studio Project on VC++.Net Plateform."
- Next in thread: Carl Daniel [VC++ MVP]: "Re: Memory leakage and the stack?"
- Reply: Carl Daniel [VC++ MVP]: "Re: Memory leakage and the stack?"
- Reply: Tim: "RE: Memory leakage and the stack?"
- Reply: Ilian Iliev: "Re: Memory leakage and the stack?"
- Reply: Dead RAM: "Re: Memory leakage and the stack?"
- Reply: anonymous_at_discussions.microsoft.com: "Memory leakage and the stack?"
- Messages sorted by: [ date ] [ thread ]