mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 06:25:30 +00:00
ICU-2541 Memory leak in RBBI rule builder fixed.
X-SVN-Rev: 10485
This commit is contained in:
parent
0fa3cf9a11
commit
0ddd9b68bf
1 changed files with 4 additions and 18 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue