Checking for memory leaks.. only active in debug mode since it's so inaccurate

This commit is contained in:
Daniel Marjamäki 2007-05-16 10:34:12 +00:00
parent 83faeeebb3
commit d3366b0267
1 changed files with 7 additions and 4 deletions

View File

@ -1008,12 +1008,15 @@ void CheckMemoryLeak()
continue; continue;
// This is highly inaccurate at the moment // This is highly inaccurate at the moment
if (Debug)
{
if (varlist[i]->value == _variable::New || varlist[i]->value == _variable::NewA) if (varlist[i]->value == _variable::New || varlist[i]->value == _variable::NewA)
{ {
std::ostringstream ostr; std::ostringstream ostr;
ostr << FileLine(it->Token) << ": Memory leak:" << VariableNames[varlist[i]->varindex]; ostr << FileLine(it->Token) << ": Memory leak:" << VariableNames[varlist[i]->varindex];
ReportErr(ostr.str()); ReportErr(ostr.str());
} }
}
// Delete this instance.. // Delete this instance..
delete varlist[i]; delete varlist[i];