Fixed ticket 134 (memory leak not detected) caused by wrong checking if code is inside class function or not

This commit is contained in:
Daniel Marjamäki 2009-03-10 20:44:24 +01:00
parent cd54a0ed3b
commit c7c13ce3c1
1 changed files with 3 additions and 3 deletions

View File

@ -1345,15 +1345,15 @@ void CheckMemoryLeakClass::CheckMemoryLeak_InFunction()
else if (tok->str() == "}")
--indentlevel;
if (tok->str() == "::")
classmember = true;
// In function..
if (indentlevel == 0)
{
if (Token::Match(tok, ") {"))
infunc = true;
else if (tok->str() == "::")
classmember = true;
else if (Token::Match(tok, "[;}]"))
infunc = classmember = false;
}