diff --git a/src/checkmemoryleak.cpp b/src/checkmemoryleak.cpp index cd7361516..0d8db59ba 100644 --- a/src/checkmemoryleak.cpp +++ b/src/checkmemoryleak.cpp @@ -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; }