diff options
31 files changed, 122 insertions, 30 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 7b5ff5ccf31..1970365f55c 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,37 @@ +Wed Jun 16 09:35:25 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com> + + * tests/Two_Objects/Object_Factory_i.cpp: + * tests/Two_Objects/server.cpp: + * tests/Faults/test_i.h: + * tests/CallbackTest/Service.cpp: + * tests/Portable_Interceptors/Dynamic/server.cpp: + * tests/Portable_Interceptors/Dynamic/client.cpp: + * tests/Portable_Interceptors/Bug_2510_Regression/server.cpp: + * tests/Portable_Interceptors/Bug_2510_Regression/client.cpp: + * tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp: + * tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp: + * tests/Portable_Interceptors/Bug_2133/client.cpp: + * tests/Portable_Interceptors/Bug_3080/client.cpp: + * tests/Portable_Interceptors/Register_Initial_References/server.cpp: + * tests/Portable_Interceptors/Register_Initial_References/Server_ORBInitializer.cpp: + * tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Collocated_Test.cpp: + * tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_main.cpp: + * tests/Portable_Interceptors/Bug_3079/Server_ORBInitializer.cpp: + * tests/Portable_Interceptors/Bug_3079/client.cpp: + * tests/Portable_Interceptors/Bug_1559/server.cpp: + * tests/Portable_Interceptors/Bug_1559/client.cpp: + * tests/Portable_Interceptors/Bug_1559/server_interceptor.cpp: + * tests/Portable_Interceptors/Bug_1559/server_interceptor.h: + * tests/Portable_Interceptors/Redirection/Server_ORBInitializer.cpp: + * tests/Portable_Interceptors/Redirection/client.cpp: + * tests/Portable_Interceptors/IORInterceptor/client.cpp: + * tests/Portable_Interceptors/Collocated/Dynamic/Collocated_Test.cpp: + * tests/Portable_Interceptors/ForwardRequest/client.cpp: + * tests/CodeSets/simple/server.cpp: + * tests/MT_BiDir/Sender_i.cpp: + * tests/MT_BiDir/Sender_i.h: + Fixed memory leaks local to these tests. + Wed Jun 16 08:40:00 UTC 2010 Simon Massey <simon dot massey at prismtech dot com> * NEWS: @@ -31,13 +65,13 @@ Tue Jun 15 17:43:23 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> * tao/PortableServer/Vector_SArgument_T.inl: * tao/PortableServer/Vector_SArgument_T.cpp: * tao/PortableServer/Vector_SArgument_T.h: - + Replace old Insert_Policy template parameter with the new tempate template version, similar to operations in Vector_Argument_T.(h,inl,cpp}. - + * tao/Vector_Argument_T.h: - + Fixed typo in comment. Tue Jun 15 17:19:46 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> @@ -48,14 +82,14 @@ Tue Jun 15 17:19:46 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> * AnyTypeCode_Adapter.h: * AnyTypeCode/AnyTypeCode_Adapter_Impl.h: * AnyTypeCode/AnyTypeCode_Adapter_Impl.cpp: - + Branch merge issues related to the Any insert policy used by interceptors. Tue Jun 15 16:01:34 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> * TAO_IDL/be/be_visitor_argument/arglist.cpp: - + Removed generation of extra leading double colon. Tue Jun 15 15:24:25 UTC 2010 Vladimir Zykov <vladimir.zykov@prismtech.com> diff --git a/TAO/tests/CallbackTest/Service.cpp b/TAO/tests/CallbackTest/Service.cpp index 79626ea80b0..56f5b8a7778 100644 --- a/TAO/tests/CallbackTest/Service.cpp +++ b/TAO/tests/CallbackTest/Service.cpp @@ -62,8 +62,8 @@ Service::call_are_you_there (Test::Callback_ptr callback) int exception_count = 0; for (int i = 0; i != iterations; ++i) { - char* outstr; - CORBA::String_out out_str (outstr); + CORBA::String_var outstr; + CORBA::String_out out_str (outstr.out ()); try { (void) callback->are_you_there (out_str); diff --git a/TAO/tests/CodeSets/simple/server.cpp b/TAO/tests/CodeSets/simple/server.cpp index e4861f12313..538f5ac20bd 100644 --- a/TAO/tests/CodeSets/simple/server.cpp +++ b/TAO/tests/CodeSets/simple/server.cpp @@ -142,6 +142,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_NEW_RETURN (my_impl, SimpleImpl (orb.in ()), -1); + PortableServer::ServantBase_var safe (my_impl); // Create CORBA object for servant and REGISTER with POA PortableServer::ObjectId_var id = diff --git a/TAO/tests/Faults/test_i.h b/TAO/tests/Faults/test_i.h index 651fc6a33cd..33cb36484d3 100644 --- a/TAO/tests/Faults/test_i.h +++ b/TAO/tests/Faults/test_i.h @@ -89,7 +89,7 @@ public: void shutdown (void); private: - CORBA::ORB_ptr orb_; + CORBA::ORB_var orb_; // The ORB Simple_Server_var server_; diff --git a/TAO/tests/MT_BiDir/Sender_i.cpp b/TAO/tests/MT_BiDir/Sender_i.cpp index 2ebfaef6978..131b21cd59d 100644 --- a/TAO/tests/MT_BiDir/Sender_i.cpp +++ b/TAO/tests/MT_BiDir/Sender_i.cpp @@ -7,7 +7,7 @@ ACE_RCSID(MT_BiDir, "$Id$") -Sender_i::Sender_i (int no_clients, +Sender_i::Sender_i (CORBA::ULong no_clients, ACE_Manual_Event &event) : event_ (event) , receivers_ (0) @@ -15,10 +15,8 @@ Sender_i::Sender_i (int no_clients, , last_index_ (0) , payload_ (32768) { - this->receivers_ = - new Receiver *[no_clients * sizeof (Receiver_ptr)]; - /*ACE_NEW (this->receivers_, - Receiver ** [no_clients * sizeof Receiver *]);*/ + ACE_NEW (this->receivers_, + Receiver_var [no_clients]); // Okay to have a magic number... this->payload_.length (32768); @@ -27,6 +25,10 @@ Sender_i::Sender_i (int no_clients, this->payload_[j] = (j % 256); } +Sender_i::~Sender_i (void) +{ + delete []this->receivers_; +} CORBA::Long Sender_i::receiver_object (Receiver_ptr recv) @@ -57,8 +59,8 @@ Sender_i::send_message (void) { // NOTE:No synchronization with purpose. Synchrnozing this is // going to spoil the whole purpose of this test. - int send_to = - ACE_OS::rand () % this->no_clients_; + CORBA::ULong send_to = + static_cast<CORBA::ULong> (ACE_OS::rand () % this->no_clients_); this->receivers_[send_to]->receive_payload (this->payload_); } diff --git a/TAO/tests/MT_BiDir/Sender_i.h b/TAO/tests/MT_BiDir/Sender_i.h index 419e333f0b4..79032e33f6f 100644 --- a/TAO/tests/MT_BiDir/Sender_i.h +++ b/TAO/tests/MT_BiDir/Sender_i.h @@ -20,9 +20,11 @@ class Sender_i { public: /// Constructor - Sender_i (int no_clients, + Sender_i (CORBA::ULong no_clients, ACE_Manual_Event &event); + virtual ~Sender_i (void); + // = The skeleton methods virtual CORBA::Long receiver_object (Receiver *recv); @@ -37,13 +39,13 @@ private: ACE_Manual_Event &event_; /// An array of receiver pointers - Receiver **receivers_; + Receiver_var *receivers_; /// Size of the <this->receivers_> array - int no_clients_; + CORBA::ULong no_clients_; /// Receiver index - int last_index_; + CORBA::ULong last_index_; /// Payload that is being sent Receiver::Payload payload_; diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/client.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/client.cpp index aa45de26dcc..c7f335decc8 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/client.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_1559/client.cpp @@ -104,6 +104,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) run_test (server.in ()); server->shutdown (); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/server.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/server.cpp index 2c0d6403599..ad934d1d728 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/server.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_1559/server.cpp @@ -131,6 +131,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); root_poa->destroy (1, 1); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.cpp b/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.cpp index 93af466a1c0..dff89a0c69e 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.cpp @@ -87,7 +87,7 @@ Echo_Server_Request_Interceptor::receive_request_service_contexts ( if (ACE_OS::strcmp (buf, request_msg) == 0) { ACE_DEBUG ((LM_DEBUG, "Sending LOCATION_FORWARD\n")); - throw PortableInterceptor::ForwardRequest (this->forward_location_); + throw PortableInterceptor::ForwardRequest (this->forward_location_.in ()); } else if (ACE_OS::strcmp (buf, forward_msg) == 0) { diff --git a/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.h b/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.h index 91e2d900864..33cd057ed2a 100644 --- a/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.h +++ b/TAO/tests/Portable_Interceptors/Bug_1559/server_interceptor.h @@ -53,7 +53,7 @@ public: private: const char *myname_; - CORBA::Object_ptr forward_location_; + CORBA::Object_var forward_location_; }; #if defined(_MSC_VER) diff --git a/TAO/tests/Portable_Interceptors/Bug_2133/client.cpp b/TAO/tests/Portable_Interceptors/Bug_2133/client.cpp index 1da90efa1cc..d75ca74b237 100644 --- a/TAO/tests/Portable_Interceptors/Bug_2133/client.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_2133/client.cpp @@ -40,6 +40,8 @@ parse_args (int argc, ACE_TCHAR *argv[]) int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { + CORBA::ORB_var orb; + try { PortableInterceptor::ORBInitializer_ptr temp_orb_initializer = @@ -55,7 +57,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) PortableInterceptor::register_orb_initializer (orb_initializer.in ()); - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + orb = CORBA::ORB_init (argc, argv); if (parse_args (argc, argv) != 0) return 1; @@ -82,9 +84,13 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_ERROR_RETURN ((LM_DEBUG, "Error - the remote call succeeded which is bloody miraculous given that no server is running !!\n"), 1); + + orb->destroy (); } catch (const CORBA::Exception&) { + orb->destroy (); + if (ClientRequest_Interceptor::success_flag_) { ACE_DEBUG ((LM_DEBUG, "Success - the server was unreachable and PI receive_exception was invoked.\n")); diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client.cpp b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client.cpp index c93387bb632..71f8f39bd63 100644 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/client.cpp @@ -100,6 +100,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_Thread::join (threadHandle); server->shutdown (); + + orb->destroy (); } catch (const CORBA::Exception& ex) diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/server.cpp b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/server.cpp index 9dd16ff99d7..2ee6f70d78a 100644 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/server.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/server.cpp @@ -110,6 +110,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); root_poa->destroy (1, 1); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/Bug_3079/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Bug_3079/Server_ORBInitializer.cpp index da369749751..33fb284f0c2 100644 --- a/TAO/tests/Portable_Interceptors/Bug_3079/Server_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_3079/Server_ORBInitializer.cpp @@ -34,6 +34,9 @@ Server_ORBInitializer::post_init ( ENOMEM), CORBA::COMPLETED_NO)); + PortableInterceptor::ServerRequestInterceptor_var + server_interceptor = interceptor; + info->add_server_request_interceptor (interceptor); } diff --git a/TAO/tests/Portable_Interceptors/Bug_3079/client.cpp b/TAO/tests/Portable_Interceptors/Bug_3079/client.cpp index 4b7d9a3b65e..7a89cf657e4 100644 --- a/TAO/tests/Portable_Interceptors/Bug_3079/client.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_3079/client.cpp @@ -104,6 +104,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } server->shutdown (); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/Bug_3080/client.cpp b/TAO/tests/Portable_Interceptors/Bug_3080/client.cpp index 051ec8de805..c6ed9e61acf 100644 --- a/TAO/tests/Portable_Interceptors/Bug_3080/client.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_3080/client.cpp @@ -104,6 +104,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) 1); } #endif /* TAO_HAS_INTERCEPTORS == 1 */ + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Collocated_Test.cpp b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Collocated_Test.cpp index 48882e04720..45692c0f273 100644 --- a/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Collocated_Test.cpp +++ b/TAO/tests/Portable_Interceptors/Collocated/Dynamic/Collocated_Test.cpp @@ -120,6 +120,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) "(%P|%t) ERROR:Client Interceptors not called" " properly\n")); + corb->destroy (); } catch (const CORBA::Exception&) { diff --git a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp index ab68b954615..00965c0617f 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/client.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/client.cpp @@ -125,6 +125,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) run_test (server.in ()); server->shutdown (); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/Dynamic/server.cpp b/TAO/tests/Portable_Interceptors/Dynamic/server.cpp index fe1285c5162..b06e09a630f 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/server.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/server.cpp @@ -112,6 +112,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); root_poa->destroy (1, 1); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/ForwardRequest/client.cpp b/TAO/tests/Portable_Interceptors/ForwardRequest/client.cpp index 11c70f59631..67cb50aa9c3 100644 --- a/TAO/tests/Portable_Interceptors/ForwardRequest/client.cpp +++ b/TAO/tests/Portable_Interceptors/ForwardRequest/client.cpp @@ -136,6 +136,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } server->shutdown (); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/IORInterceptor/client.cpp b/TAO/tests/Portable_Interceptors/IORInterceptor/client.cpp index e662312423c..3d9a5422dd9 100644 --- a/TAO/tests/Portable_Interceptors/IORInterceptor/client.cpp +++ b/TAO/tests/Portable_Interceptors/IORInterceptor/client.cpp @@ -75,6 +75,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } server->shutdown (); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Collocated_Test.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Collocated_Test.cpp index 8f90b86c2f0..01e78ae2b96 100644 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Collocated_Test.cpp +++ b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/Collocated_Test.cpp @@ -206,6 +206,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { return 1; } + + corb->destroy (); } catch (const CORBA::Exception&) { diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_main.cpp b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_main.cpp index 83088e5deb6..cab19179fe0 100644 --- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_main.cpp +++ b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/client_main.cpp @@ -119,6 +119,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) number_called, expected_interceptor_check)); return 1; } + + orb->destroy (); } catch (const CORBA::Exception&) { diff --git a/TAO/tests/Portable_Interceptors/Redirection/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Redirection/Server_ORBInitializer.cpp index da369749751..33fb284f0c2 100644 --- a/TAO/tests/Portable_Interceptors/Redirection/Server_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Redirection/Server_ORBInitializer.cpp @@ -34,6 +34,9 @@ Server_ORBInitializer::post_init ( ENOMEM), CORBA::COMPLETED_NO)); + PortableInterceptor::ServerRequestInterceptor_var + server_interceptor = interceptor; + info->add_server_request_interceptor (interceptor); } diff --git a/TAO/tests/Portable_Interceptors/Redirection/client.cpp b/TAO/tests/Portable_Interceptors/Redirection/client.cpp index 0825bae9023..0c591bae70d 100644 --- a/TAO/tests/Portable_Interceptors/Redirection/client.cpp +++ b/TAO/tests/Portable_Interceptors/Redirection/client.cpp @@ -100,6 +100,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) } server->shutdown (); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/Register_Initial_References/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Register_Initial_References/Server_ORBInitializer.cpp index 1e3d3682b0c..529c994c465 100644 --- a/TAO/tests/Portable_Interceptors/Register_Initial_References/Server_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Register_Initial_References/Server_ORBInitializer.cpp @@ -23,18 +23,19 @@ Server_ORBInitializer::pre_init ( POA_TestModule::test* test = 0; ACE_NEW (test, test_i); + PortableServer::ServantBase_var safe (test); - CORBA::Object_ptr object = test->_this (); + CORBA::Object_var object = test->_this (); orbinitinfo->register_initial_reference ("MyService", - object); + object.in ()); bool invalid_name = false; try { // Registering with an empty string should give an exception orbinitinfo->register_initial_reference ("", - object); + object.in ()); } catch (const PortableInterceptor::ORBInitInfo::InvalidName&) { diff --git a/TAO/tests/Portable_Interceptors/Register_Initial_References/server.cpp b/TAO/tests/Portable_Interceptors/Register_Initial_References/server.cpp index ad99e8ca34f..98853ebc269 100644 --- a/TAO/tests/Portable_Interceptors/Register_Initial_References/server.cpp +++ b/TAO/tests/Portable_Interceptors/Register_Initial_References/server.cpp @@ -16,18 +16,19 @@ int test_orb (CORBA::ORB_ptr orb) POA_TestModule::test* test = 0; ACE_NEW_RETURN (test, test_i, 1); + PortableServer::ServantBase_var safe (test); - CORBA::Object_ptr object = test->_this (); + CORBA::Object_var object = test->_this (); orb->register_initial_reference ("ORBMyService", - object); + object.in ()); bool invalid_name = false; try { // Registering with an empty string should give an exception orb->register_initial_reference ("", - object); + object.in ()); } catch (const CORBA::ORB::InvalidName&) { @@ -49,7 +50,7 @@ int test_orb (CORBA::ORB_ptr orb) { // Registering with an duplicate string should give an exception orb->register_initial_reference ("ORBMyService", - object); + object.in ()); } catch (const CORBA::ORB::InvalidName&) { @@ -118,6 +119,10 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) CORBA::ORB_var second_orb = CORBA::ORB_init (argc, argv, "SecondORB"); + + second_orb->destroy (); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp index f44e09e9bfe..9f6fb5660ef 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/client.cpp @@ -105,6 +105,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) run_test (server.in ()); server->shutdown (); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp index 6af4f37250e..f22ac303516 100644 --- a/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp +++ b/TAO/tests/Portable_Interceptors/Service_Context_Manipulation/server.cpp @@ -112,6 +112,8 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); root_poa->destroy (1, 1); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Two_Objects/Object_Factory_i.cpp b/TAO/tests/Two_Objects/Object_Factory_i.cpp index 107826a2312..426ab1c5052 100644 --- a/TAO/tests/Two_Objects/Object_Factory_i.cpp +++ b/TAO/tests/Two_Objects/Object_Factory_i.cpp @@ -22,10 +22,11 @@ Object_Factory_i::create_first (void) { First_i *first_impl; - // @@ Dont you want to transfer ownership to the POA? ACE_NEW_THROW_EX (first_impl, First_i (orb_.in(), two_way_done_ ), CORBA::NO_MEMORY() ); + // Ownership is transfered to the POA. + PortableServer::ServantBase_var safe (first_impl); CORBA::Object_var poa_object = this->orb_->resolve_initial_references("RootPOA"); @@ -54,6 +55,8 @@ Object_Factory_i::create_second (void) Second_i (orb_.in(), length_, two_way_done_), CORBA::NO_MEMORY ()); + // Ownership is transfered to the POA. + PortableServer::ServantBase_var safe (second_impl); CORBA::Object_var poa_object = this->orb_->resolve_initial_references("RootPOA"); diff --git a/TAO/tests/Two_Objects/server.cpp b/TAO/tests/Two_Objects/server.cpp index d50f6c745d3..18a19d7071f 100644 --- a/TAO/tests/Two_Objects/server.cpp +++ b/TAO/tests/Two_Objects/server.cpp @@ -86,6 +86,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_NEW_THROW_EX (factory_impl, Object_Factory_i (orb.in (), msglen), CORBA::NO_MEMORY ()); + PortableServer::ServantBase_var safe (factory_impl); // _this method registers the object withe the POA and returns // an object reference |