Fixed ticket 134 (memory leak not detected) caused by wrong checking if code is inside class function or not
This commit is contained in:
parent
cd54a0ed3b
commit
c7c13ce3c1
|
@ -1345,15 +1345,15 @@ void CheckMemoryLeakClass::CheckMemoryLeak_InFunction()
|
||||||
else if (tok->str() == "}")
|
else if (tok->str() == "}")
|
||||||
--indentlevel;
|
--indentlevel;
|
||||||
|
|
||||||
if (tok->str() == "::")
|
|
||||||
classmember = true;
|
|
||||||
|
|
||||||
// In function..
|
// In function..
|
||||||
if (indentlevel == 0)
|
if (indentlevel == 0)
|
||||||
{
|
{
|
||||||
if (Token::Match(tok, ") {"))
|
if (Token::Match(tok, ") {"))
|
||||||
infunc = true;
|
infunc = true;
|
||||||
|
|
||||||
|
else if (tok->str() == "::")
|
||||||
|
classmember = true;
|
||||||
|
|
||||||
else if (Token::Match(tok, "[;}]"))
|
else if (Token::Match(tok, "[;}]"))
|
||||||
infunc = classmember = false;
|
infunc = classmember = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue