From d3366b026712671fab14661e311d9f67bb8e6b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 16 May 2007 10:34:12 +0000 Subject: [PATCH] Checking for memory leaks.. only active in debug mode since it's so inaccurate --- main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index febfb10b7..8d52ce2e9 100644 --- a/main.cpp +++ b/main.cpp @@ -1008,11 +1008,14 @@ void CheckMemoryLeak() continue; // This is highly inaccurate at the moment - if (varlist[i]->value == _variable::New || varlist[i]->value == _variable::NewA) + if (Debug) { - std::ostringstream ostr; - ostr << FileLine(it->Token) << ": Memory leak:" << VariableNames[varlist[i]->varindex]; - ReportErr(ostr.str()); + if (varlist[i]->value == _variable::New || varlist[i]->value == _variable::NewA) + { + std::ostringstream ostr; + ostr << FileLine(it->Token) << ": Memory leak:" << VariableNames[varlist[i]->varindex]; + ReportErr(ostr.str()); + } } // Delete this instance..