summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2018-02-15 10:32:39 +0100
committerGitHub <noreply@github.com>2018-02-15 10:32:39 +0100
commit4665969af11545a831900244fd4ac6fa6f30a155 (patch)
treeaef1294c6a99db9da67bc36df311bf0f01e6e6f6
parentcbb40b5f6f29e9c1755377a9da7441f7c3c9f010 (diff)
parentc8d9edf5117f6aa7334bd63e351e816d4946aece (diff)
downloadATCD-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.cpp16
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;