cmCTestScriptHandler: Simplify deletes.

Deleting a nullptr is fine.
This commit is contained in:
Stephen Kelly 2015-08-24 23:00:21 +02:00
parent 7fdc9a8b5f
commit 2f2d4da9dd
1 changed files with 9 additions and 26 deletions

View File

@ -126,20 +126,14 @@ void cmCTestScriptHandler::Initialize()
this->ScriptStartTime = 0; this->ScriptStartTime = 0;
this->Makefile = 0; this->Makefile = 0;
if (this->LocalGenerator)
{
delete this->LocalGenerator; delete this->LocalGenerator;
}
this->LocalGenerator = 0; this->LocalGenerator = 0;
if (this->GlobalGenerator)
{
delete this->GlobalGenerator; delete this->GlobalGenerator;
}
this->GlobalGenerator = 0; this->GlobalGenerator = 0;
if (this->CMake)
{
delete this->CMake; delete this->CMake;
}
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@ -147,20 +141,9 @@ cmCTestScriptHandler::~cmCTestScriptHandler()
{ {
// local generator owns the makefile // local generator owns the makefile
this->Makefile = 0; this->Makefile = 0;
if (this->LocalGenerator)
{
delete this->LocalGenerator; delete this->LocalGenerator;
}
this->LocalGenerator = 0;
if (this->GlobalGenerator)
{
delete this->GlobalGenerator; delete this->GlobalGenerator;
}
this->GlobalGenerator = 0;
if (this->CMake)
{
delete this->CMake; delete this->CMake;
}
} }