From d83514d953c4d39e3aab7958ba5a13eeea4bf1bf Mon Sep 17 00:00:00 2001 From: mayur Date: Wed, 10 Jul 2002 17:22:31 +0000 Subject: Wed Jul 10 10:19:25 2002 Mayur Deshpande --- TAO/ChangeLog | 9 +++++++++ TAO/tests/AMH_Exceptions/server.cpp | 10 +++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 4be149f71ab..95cb0f748e5 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,12 @@ +Wed Jul 10 10:19:25 2002 Mayur Deshpande + + * tests/AMH_Exceptions/server.cpp (test_method): + + Allocate the exception on the heap. The ExceptionHolder now + requires that all exceptions it is constructed with, be allocated + on the heap since the ExceptionHolder takes over ownership of + the exception and deletes it later. + Wed Jul 10 12:19:39 2002 Jeff Parsons * TAO_IDL/include/utl_identifier.h: diff --git a/TAO/tests/AMH_Exceptions/server.cpp b/TAO/tests/AMH_Exceptions/server.cpp index 459ba559681..1716b6ff1f6 100644 --- a/TAO/tests/AMH_Exceptions/server.cpp +++ b/TAO/tests/AMH_Exceptions/server.cpp @@ -44,14 +44,18 @@ ST_AMH_Servant::test_method (Test::AMH_RoundtripResponseHandler_ptr _tao_rh, TAO_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) { + // Throw an overload exception ACE_DECLARE_NEW_CORBA_ENV; - // Throw an overload exception - Test::ServerOverload ts; - Test::AMH_RoundtripExceptionHolder holder (&ts); + + Test::ServerOverload *ts = new Test::ServerOverload; + + // Calee owns the memory now. Need not delete 'ts' + Test::AMH_RoundtripExceptionHolder holder (ts); ACE_TRY { + ACE_DEBUG ((LM_DEBUG, "Throwing exception\n")); _tao_rh->test_method_excep (&holder ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } -- cgit v1.2.1