diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2018-02-15 10:32:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-15 10:32:39 +0100 |
commit | 4665969af11545a831900244fd4ac6fa6f30a155 (patch) | |
tree | aef1294c6a99db9da67bc36df311bf0f01e6e6f6 | |
parent | cbb40b5f6f29e9c1755377a9da7441f7c3c9f010 (diff) | |
parent | c8d9edf5117f6aa7334bd63e351e816d4946aece (diff) | |
download | ATCD-4665969af11545a831900244fd4ac6fa6f30a155.tar.gz |
Merge pull request #572 from jwillemsen/jwi-taoidlleak
Fixed memory leak when we have a wstrval
-rw-r--r-- | TAO/TAO_IDL/ast/ast_expression.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/TAO/TAO_IDL/ast/ast_expression.cpp b/TAO/TAO_IDL/ast/ast_expression.cpp index 8f27b0346a0..aac7235ff2c 100644 --- a/TAO/TAO_IDL/ast/ast_expression.cpp +++ b/TAO/TAO_IDL/ast/ast_expression.cpp @@ -3179,11 +3179,19 @@ AST_Expression::ast_accept (ast_visitor *visitor) void AST_Expression::destroy (void) { - if (0 != this->pd_ev && EV_string == this->pd_ev->et) + if (0 != this->pd_ev) { - this->pd_ev->u.strval->destroy (); - delete this->pd_ev->u.strval; - this->pd_ev->u.strval = 0; + if (EV_string == this->pd_ev->et) + { + this->pd_ev->u.strval->destroy (); + delete this->pd_ev->u.strval; + this->pd_ev->u.strval = 0; + } + else if (EV_wstring == this->pd_ev->et) + { + ACE::strdelete (this->pd_ev->u.wstrval); + this->pd_ev->u.wstrval = 0; + } } delete this->pd_ev; |