memory leaks: minor cleanups

This commit is contained in:
Daniel Marjamäki 2009-10-08 22:30:33 +02:00
parent b95f0eaa41
commit 6923a09001
1 changed files with 1 additions and 14 deletions

View File

@ -1447,13 +1447,6 @@ void CheckMemoryLeakInFunction::simplifycode(Token *tok, bool &all)
done = false; done = false;
} }
// Replace "dealloc use ;" with "dealloc ;"
if (Token::simpleMatch(tok2, "dealloc use ;"))
{
Token::eraseTokens(tok2, tok2->tokAt(2));
done = false;
}
// Remove the "if break|continue ;" that follows "dealloc ; alloc ;" // Remove the "if break|continue ;" that follows "dealloc ; alloc ;"
if (! _settings->_showAll && Token::Match(tok2, "dealloc ; alloc ; if break|continue ;")) if (! _settings->_showAll && Token::Match(tok2, "dealloc ; alloc ; if break|continue ;"))
{ {
@ -1711,13 +1704,7 @@ void CheckMemoryLeakInFunction::simplifycode(Token *tok, bool &all)
const Token *CheckMemoryLeakInFunction::findleak(const Token *tokens, bool all) const Token *CheckMemoryLeakInFunction::findleak(const Token *tokens, bool all)
{ {
const Token *result = 0; const Token *result;
// No allocation at all => no leaks
if (Token::findmatch(tokens, "alloc") == 0)
{
return NULL;
}
if ((result = Token::findmatch(tokens, "loop alloc ;")) != NULL) if ((result = Token::findmatch(tokens, "loop alloc ;")) != NULL)
{ {