mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 09:21:03 +00:00
ICU-2541 Memory leak in RBBI rule builder fixed.
X-SVN-Rev: 10484
This commit is contained in:
parent
2af8b25b5a
commit
0fa3cf9a11
1 changed files with 4 additions and 2 deletions
|
@ -168,7 +168,7 @@ RBBINode *RBBINode::cloneTree() {
|
|||
// reference, it remains unchanged - the root we started with
|
||||
// is the root we return. If, however, the root was a variable
|
||||
// reference, the root of the newly cloned replacement tree will
|
||||
// be returned.
|
||||
// be returned, and the original tree deleted.
|
||||
//
|
||||
// This function works by recursively walking the tree
|
||||
// without doing anything until a variable reference is
|
||||
|
@ -178,7 +178,9 @@ RBBINode *RBBINode::cloneTree() {
|
|||
//-------------------------------------------------------------------------
|
||||
RBBINode *RBBINode::flattenVariables() {
|
||||
if (fType == varRef) {
|
||||
return fLeftChild->cloneTree();
|
||||
RBBINode *retNode = fLeftChild->cloneTree();
|
||||
delete this;
|
||||
return retNode;
|
||||
}
|
||||
|
||||
if (fLeftChild != NULL) {
|
||||
|
|
Loading…
Add table
Reference in a new issue