Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1113#discussion_r120700381
--- Diff: core/sql/optimizer/ControlDB.cpp ---
@@ -108,7 +108,12 @@ ControlDB::~ControlDB()
void ControlDB::setRequiredShape(ControlQueryShape *shape)
{
- delete requiredShape_;
+ if (requiredShape_)
+ {
+ delete requiredShape_->getShape();
+ delete requiredShape_;
--- End diff --
If the NADELETE macro can't be used, then it is fine to stick with delete.
However, NABasicObject also has the default constructor and hence it is
possible to create objects without heap. I guess overloaded delete operator
would take care of this too.
I preferred NADELETE macro because it is easy to read that it is being
deleted from the heap.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---