View Full Version : visual studio 2008 debugger problem
Hi, i have a strange problem visual studio 2008 , doesn't detect memory leaks, even if i cause them on purpouse, am i missing something ?
I am not using managed extensions.
Thanks
Kenneth Gorking
10-29-2008, 08:10 AM
You need to enable it using _CrtSetDbgFlag (http://msdn.microsoft.com/en-us/library/5at7yxcs.aspx) and _CRTDBG_LEAK_CHECK_DF.
Done, but still no report, the DEBUG option is set .
tried also to do write instructions into the program to set it manually
but still no report
i don't know if my ( big ) app is leaking or not
why Ms messes things up every time ?
Kenneth Gorking
10-30-2008, 07:47 AM
Done, but still no report, the DEBUG option is set .
tried also to do write instructions into the program to set it manually
but still no report
i don't know if my ( big ) app is leaking or not
It only works with the _DEBUG macro, but that might be what you meant. If nothing is dumped to the Debug Output Window, then there are either no memory leaks, or something else is wrong.
why Ms messes things up every time ?
The thousands upon thoundsands of other people using msvc are not having any problems, just you :)
It only works with the _DEBUG macro, but that might be what you meant. If nothing is dumped to the Debug Output Window, then there are either no memory leaks, or something else is wrong.
The thousands upon thoundsands of other people using msvc are not having any problems, just you :)
I have created a situation where a memory leak should be reported, and visual studio didn't , obviously there is something wrong, and i would like to have an advice from more of this billions of people , not just 2 , even msdn forumers are avoid the questions
Kenneth Gorking
10-30-2008, 01:13 PM
I just tried a small example, and it seems that you also need the _CRTDBG_ALLOC_MEM_DF flag. The following code:
int main(int argc, char* argv[])
{
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
int *i = (int*)malloc(128);
return 0;
}
dumps the following:
Detected memory leaks!
Dumping objects ->
{102} normal block at 0x00857220, 128 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
Object dump complete.
Tried that too, visual studio is not reporting memory leaks
vBulletin, Copyright ©2000-2010, Jelsoft Enterprises Ltd.