diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-03-31 01:31:36 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-03-31 01:31:36 +0000 |
commit | 7f94238dd3d2623e416fb1e8236e55848fc2c8f8 (patch) | |
tree | 36d16e6153ecf886f48befd99f12bb08d8427de6 /cpp/test/Ice/optional/TestI.cpp | |
parent | Fixed previous Util.py fix (diff) | |
download | ice-7f94238dd3d2623e416fb1e8236e55848fc2c8f8.tar.bz2 ice-7f94238dd3d2623e416fb1e8236e55848fc2c8f8.tar.xz ice-7f94238dd3d2623e416fb1e8236e55848fc2c8f8.zip |
Fixes for ICE-7012 - fixed some leaks in IceSSL/tests
Diffstat (limited to 'cpp/test/Ice/optional/TestI.cpp')
-rw-r--r-- | cpp/test/Ice/optional/TestI.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/cpp/test/Ice/optional/TestI.cpp b/cpp/test/Ice/optional/TestI.cpp index b5350709b14..9a736a1c89d 100644 --- a/cpp/test/Ice/optional/TestI.cpp +++ b/cpp/test/Ice/optional/TestI.cpp @@ -25,11 +25,25 @@ InitialI::shutdown(const Current& current) current.adapter->getCommunicator()->shutdown(); } -ValuePtr -InitialI::pingPong(ICE_IN(ValuePtr) obj, const Current&) +#ifdef ICE_CPP11_MAPPING +Test::Initial::PingPongMarshaledResult +InitialI::pingPong(shared_ptr<Value> obj, const Current& current) { - return obj; + auto result = PingPongMarshaledResult(obj, current); + if(dynamic_pointer_cast<MultiOptional>(obj)) + { + // Break cyclic reference count + dynamic_pointer_cast<MultiOptional>(obj)->k = shared_ptr<MultiOptional>(); + } + return result; } +#else +Ice::ValuePtr +InitialI::pingPong(const Ice::ValuePtr& obj, const Current& current) +{ + return obj; +} +#endif void InitialI::opOptionalException(ICE_IN(Optional<Int>) a, |