Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #169, Remove unnecessary null pointer checks #189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/PLASMA/ConstraintEngine/base/DataType.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ DataType::~DataType()
{
m_id.remove();

if (m_baseDomain != NULL)
delete m_baseDomain;
delete m_baseDomain;
}

const DataTypeId DataType::getId() const { return m_id; }
Expand Down
6 changes: 2 additions & 4 deletions src/PLASMA/PlanDatabase/base/ObjectType.cc
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,7 @@ void* ObjectEvalContext::getElement(const std::string& name) const {

InterpretedObjectFactory::~InterpretedObjectFactory()
{
if (m_superCallExpr != NULL)
delete m_superCallExpr;
delete m_superCallExpr;

for (unsigned int i=0; i < m_constructorBody.size(); i++)
delete m_constructorBody[i];
Expand Down Expand Up @@ -655,8 +654,7 @@ void* ObjectFactoryEvalContext::getElement(const std::string& name) const {
);
ObjectEvalContext evalContext(&factoryEvalContext,instance);

if (m_superCallExpr != NULL)
m_superCallExpr->eval(evalContext);
m_superCallExpr->eval(evalContext);

for (unsigned int i=0; i < m_constructorBody.size(); i++)
m_constructorBody[i]->eval(evalContext);
Expand Down
6 changes: 2 additions & 4 deletions src/PLASMA/Resource/component/FlowProfile.hh
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,11 @@ private:
*/
template<typename FlowGraphType>
void initializeGraphs() {
if(m_lowerLevelGraph != NULL)
delete m_lowerLevelGraph;
delete m_lowerLevelGraph;
m_lowerLevelGraph = new FlowGraphType(m_dummySourceTransaction,
m_dummySinkTransaction, true);

if(m_upperLevelGraph != NULL)
delete m_upperLevelGraph;
delete m_upperLevelGraph;
m_upperLevelGraph = new FlowGraphType(m_dummySourceTransaction,
m_dummySinkTransaction, false);
}
Expand Down
3 changes: 1 addition & 2 deletions src/PLASMA/Solvers/component/OpenConditionDecisionPoint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ SupportedOCDecisionPoint::~SupportedOCDecisionPoint()

m_choices.clear();

if (m_heuristic != NULL)
delete m_heuristic;
delete m_heuristic;
}

std::string SupportedOCDecisionPoint::toString() const
Expand Down
2 changes: 1 addition & 1 deletion src/PLASMA/Utils/base/Logger-log4cpp.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public:
//TODO - mcr - iterate through and delete loggers
}
delete loggers;
if( instance != NULL ) {delete instance;}
delete instance;
}

void readConfiguration( string configFilename ) {
Expand Down