tokenizer: Added DeallocateTokens to the destructor so it's not necessary to cleanup manually

This commit is contained in:
Daniel Marjamäki 2008-11-22 09:44:02 +00:00
parent 9ce8918895
commit 2db69e6072
10 changed files with 220 additions and 242 deletions

View File

@ -57,8 +57,6 @@ private:
// Check for memory leaks..
CheckBufferOverrunClass checkBufferOverrun( &tokenizer, this );
checkBufferOverrun.CheckBufferOverrun();
tokenizer.DeallocateTokens();
}
void run()

View File

@ -60,8 +60,6 @@ private:
// Check for memory leaks..
CheckOther checkOther( &tokenizer, this );
checkOther.CheckCharVariable();
tokenizer.DeallocateTokens();
}
void array_index()

View File

@ -51,8 +51,6 @@ private:
settings._checkCodingStyle = true;
CheckClass checkClass( &tokenizer, settings, this );
checkClass.CheckConstructors();
tokenizer.DeallocateTokens();
}
void run()

View File

@ -51,8 +51,6 @@ private:
// Check for memory leaks..
CheckOther checkOther( &tokenizer, this );
checkOther.CheckUnsignedDivision();
tokenizer.DeallocateTokens();
}
void run()

View File

@ -50,8 +50,6 @@ private:
// Check for unused variables..
CheckOther checkOther( &tokenizer, this );
checkOther.CheckIncompleteStatement();
tokenizer.DeallocateTokens();
}
void run()

View File

@ -54,8 +54,6 @@ private:
tokenizer.FillFunctionList(0);
CheckMemoryLeakClass checkMemoryLeak( &tokenizer, settings, this );
checkMemoryLeak.CheckMemoryLeak();
tokenizer.DeallocateTokens();
}
void run()

View File

@ -82,8 +82,6 @@ private:
// Compare..
ASSERT_EQUALS( true, cmptok(expected, tokenizer.tokens()) );
tokenizer.DeallocateTokens();
}
@ -99,8 +97,6 @@ private:
// Expected result..
ASSERT_EQUALS( std::string(10000,'a'), std::string(tokenizer.tokens()->str) );
tokenizer.DeallocateTokens();
}
@ -135,8 +131,6 @@ private:
// Compare..
ASSERT_EQUALS( true, cmptok(expected, tokenizer.tokens()) );
tokenizer.DeallocateTokens();
}

View File

@ -57,8 +57,6 @@ private:
settings._checkCodingStyle = true;
CheckClass checkClass( &tokenizer, settings, this );
checkClass.CheckUnusedPrivateFunctions();
tokenizer.DeallocateTokens();
}

View File

@ -49,8 +49,6 @@ private:
// Check for unused variables..
CheckOther checkOther( &tokenizer, this );
checkOther.CheckStructMemberUsage();
tokenizer.DeallocateTokens();
}
void run()

View File

@ -58,7 +58,7 @@ Tokenizer::Tokenizer(ErrorLogger *errorLogger)
Tokenizer::~Tokenizer()
{
DeallocateTokens();
}
//---------------------------------------------------------------------------