diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2012-04-03 16:59:01 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2012-04-03 16:59:01 +0000 |
commit | f33e041f5dcf5eccb576fa0be39ff394745aa888 (patch) | |
tree | 9d3458425bfb8895ea94af28164a4ad844111dbc | |
parent | e76613a6fc6407f5268ba5f0f7eb964a8b06505c (diff) | |
download | ATCD-f33e041f5dcf5eccb576fa0be39ff394745aa888.tar.gz |
ChangeLogTag: Tue Apr 3 16:52:21 UTC 2012 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 10 | ||||
-rw-r--r-- | TAO/tao/AnyTypeCode/Any.cpp | 18 |
2 files changed, 23 insertions, 5 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 4b2898795e6..7208eaac3a0 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,13 @@ +Tue Apr 3 16:52:21 UTC 2012 Jeff Parsons <j.parsons@vanderbilt.edu> + + * tao/AnyTypeCode/Any.cpp: + + Removed strdelete of string and wstring buffers returned in Any extraction + to std::string and std::wstring, since the Any still owns them and will + free them upon its destruction. Thanks to Thomas Stegemann + <Thomas dot Stegemann at materna dot de> for reporting the problem and + supplying a patch. + Fri Mar 30 13:04:27 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl> * TAO_IDL/be/be_visitor_component/component_exh.cpp: diff --git a/TAO/tao/AnyTypeCode/Any.cpp b/TAO/tao/AnyTypeCode/Any.cpp index fa62d4235fd..127ceddbd01 100644 --- a/TAO/tao/AnyTypeCode/Any.cpp +++ b/TAO/tao/AnyTypeCode/Any.cpp @@ -753,8 +753,12 @@ operator >>= (const CORBA::Any &any, std::string &str) { const char *buf = 0; CORBA::Boolean flag = any >>= buf; - str.assign (buf); - ACE::strdelete (const_cast <char *> (buf)); + + if (buf != 0) + { + str.assign (buf); + } + return flag; } @@ -763,9 +767,13 @@ CORBA::Boolean operator >>= (const CORBA::Any &any, std::wstring &str) { const wchar_t *buf = 0; - CORBA::Boolean const flag = any >>= buf; - str.assign (buf); - ACE::strdelete (const_cast <wchar_t *> (buf)); + CORBA::Boolean flag = any >>= buf; + + if (buf != 0) + { + str.assign (buf); + } + return flag; } #endif |