Re: memory leak?



It depends on what you mean by "near the exit of the program". The C debug runtime does
its check for memory leaks before static destructors are called, and I'm not sure where it
fits with respect to ExitInstance, but your report might be spurious. Without knowing the
details of where you put it, though, it is hard to tell.
joe

On Fri, 27 Jul 2007 17:53:56 -0000, wanwan <ericwan78@xxxxxxxxx> wrote:

In my program i have a char pointer where I use malloc() to allocate
230400 elements for use in video stream. Near the exit of the
application, I use free() to free the pointer.

in debug mode, Visual Studio still detected memory leak. Why?
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: EXE terminates automatically.
    ... Memory leaks: I am guessing here. ... Unhandled exceptions, someone calling exit() in a subroutine, etc. ...
    (microsoft.public.vc.mfc)
  • Re: How to (easily) trace leaking memory
    ... correctly) on exit if there are any memory leaks. ... the process of then finding the exact location of the leak a bit ... Do you generate a log file with the full version of FastMM4? ...
    (borland.public.delphi.non-technical)
  • Re: CreateQuery Debug SDK bug?
    ... Select Debug runtime, check all checkboxes (Maximum validation, Enable ... Write this code to function "OnCreateDevice": ... Compile "release". ... No memory leaks. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • The proper way...
    ... What's the proper way to exit an MFC/C++ application? ... and when the user clicks on it I ask him (with MessageBox) 'Are you sure?' ... debbug mode and after that operation, the debbug window says that there is ... application with ALT+F4 there is no memory leaks? ...
    (microsoft.public.vc.mfc)
  • Re: EXE terminates automatically.
    ... standard IDE stuff): ... Application doesnt have "exit" statements. ... Memory leaks: I am guessing here. ...
    (microsoft.public.vc.mfc)