Browse Source

Fix memory leak

test
Michael Uleysky 9 years ago
parent
commit
e39589f216
  1. 2
      src/deptree.cpp

2
src/deptree.cpp

@ -274,6 +274,7 @@ void TreeEvaluate(std::mutex* mtx, int* errflag, DepTree::LeafVector* leafs, con
} }
mtx[1].unlock(); mtx[1].unlock();
// End locked section // End locked section
delete eob;
leaf->parents.clear(); leaf->parents.clear();
delete leaf; delete leaf;
} }
@ -364,6 +365,7 @@ void TreeEvaluate(int* errflag, DepTree::LeafVector* leafs)
// If node have no children, it's a new leaf node // If node have no children, it's a new leaf node
if(0==i->childrens.size() && DepTree::ROOT!=i->type) leafs->push_back(i); if(0==i->childrens.size() && DepTree::ROOT!=i->type) leafs->push_back(i);
} }
delete eob;
leaf->parents.clear(); leaf->parents.clear();
delete leaf; delete leaf;
} }

Loading…
Cancel
Save