ICU-2541 Memory leak in RBBI rule builder fixed.

X-SVN-Rev: 10485
This commit is contained in:
Andy Heninger 2002-12-05 00:18:16 +00:00
parent 0fa3cf9a11
commit 0ddd9b68bf

View file

@ -184,31 +184,17 @@ RBBINode *RBBINode::flattenVariables() {
}
if (fLeftChild != NULL) {
if (fLeftChild->fType==varRef) {
RBBINode *oldChild = fLeftChild;
fLeftChild = oldChild->cloneTree();
fLeftChild->fParent = this;
delete oldChild;
} else {
fLeftChild->flattenVariables();
}
fLeftChild = fLeftChild->flattenVariables();
fLeftChild->fParent = this;
}
if (fRightChild != NULL) {
if (fRightChild->fType==varRef) {
RBBINode *oldChild = fRightChild;
fRightChild = oldChild->cloneTree();
fRightChild->fParent = this;
delete oldChild;
} else {
fRightChild->flattenVariables();
}
fRightChild = fRightChild->flattenVariables();
fRightChild->fParent = this;
}
return this;
}
//-------------------------------------------------------------------------
//
// flattenSets Walk the parse tree, replacing any nodes of type setRef