Skip to content

Commit

Permalink
improving destructor for hNode
Browse files Browse the repository at this point in the history
  • Loading branch information
mayagokhale committed Jan 9, 2020
1 parent bad30db commit 4eec0c0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugins/xlat/hNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,17 @@ namespace hnode {
h_name = s;
h_op = h;
}

~hNode() { if (!is_leaf) child_list.clear(); }

~hNode() {
if (!child_list.empty()) {
list<hNodep>::iterator it;
for (it = child_list.begin(); it != child_list.end(); ++it) {
delete *it;
}
}
//cout << "visited hNode destructor\n";

}


void setleaf(string s, hdlopsEnum h) {
Expand Down

0 comments on commit 4eec0c0

Please sign in to comment.