As noted repeatedly in Iatent's thread, properly cleaning up your arrays (via delete[] or using std::vectors) will prevent "false" positives in your leak detection tools when trying to find another memory leak that is, say, leaking fast enough to crash your program.
If the goal is faster code, you might consider skipping cleanup in release mode.
If the goal is easier code to write, it'll unfortunately only be counter-productive in the long run.
Funny thing is all the vectors I initiate show as giving memory leaks in VSC++ 2010. I don't allocate memory for them.
I get a memory leak detection here
void ProjectDoma::AddString(string str, float x, float y, int size, int fontnum)
{
if(fontnum == 0)
commonstrings_.push_back(StringDisplay(str, x, y, size));
}
and here
void ProjectDoma::ModifyLetter(float posx, float posy, float width, float height, float xoff, float yoff, float xadv, int fontnum)
{
if(fontnum == 0)
{
commonletters_.push_back(LetterFont(posx, posy, width, height, xoff, yoff, xadv));
}
}
These vectors aren't destroyed until the program is closed. Is that why I am getting memory leak notifications? Because the memory leak detector doesn't see them get destroyed for the length of the program?
Checking memory usage in task manager shows there is no memory leaks, the memory usage is consistent.