| |

VerySource

 Forgot password?
 Register
Search
View: 662|Reply: 2

There is a problem debugging the Release.

[Copy link]

2

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-1-17 16:40:01
| Show all posts |Read mode
Debugging under Debug shows that there is no memory leak, but it shows memory leak when debugging under Release

Leak, I located some new, and finally deleted it. But still showing leaks, I intend to say this is VC6 a

A BUG. Since there are only tens of bytes in and out, and my program uses memory more volatile, so use tasks

Manager is hard to see the change. Depressed.

Do you encounter different debugging results under Release and Debug? I sometimes find the same int

When the variables reach the same point, the values ​​under Release are weird.
Reply

Use magic Report

4

Threads

16

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 Unknown

Post time: 2020-1-22 22:54:01
| Show all posts
Release check is very strict, it is a problem with your program
Reply

Use magic Report

2

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-1-26 08:18:01
| Show all posts
Maybe, upstairs, try the following program, Debug reports leaks, but Release will not report, so I still insist that Release debugging is a bit messy.
#include <iostream>
#include <crtdbg.h>
using namespace std;

struct bit
{
int a: 3;
};
bit * F1 ()
{
bit * p = new bit;
return p;
}
bit * F2 ()
{
bit * p = F1 ();
return p;
}
bit * F3 ()
{
bit * p = F2 ();
return p;
}
int main ()
{

_CrtSetDbgFlag (_CrtSetDbgFlag (_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);

F3 (); // There is a memory leak here, it is OK to delete F3 () instead.

return 0;
}
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list