summaryrefslogtreecommitdiff
path: root/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerServer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerServer.cpp')
-rw-r--r--TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerServer.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerServer.cpp b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerServer.cpp
index 66c731f89e3..c1efbd4172b 100644
--- a/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerServer.cpp
+++ b/TAO/DevGuideExamples/PortableInterceptors/SimpleCodec/MessengerServer.cpp
@@ -14,12 +14,8 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
try
{
- ServerInitializer *temp_initializer = 0;
-
- temp_initializer = new ServerInitializer;
-
PortableInterceptor::ORBInitializer_var orb_initializer =
- temp_initializer;
+ new ServerInitializer;
PortableInterceptor::register_orb_initializer (orb_initializer.in ());
@@ -35,12 +31,12 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
mgr->activate();
// Create an object
- Messenger_i messenger_servant;
+ PortableServer::Servant_var<Messenger_i> messenger_servant = new Messenger_i;
// Register the servant with the RootPOA, obtain its object
// reference, stringify it, and write it to a file.
PortableServer::ObjectId_var oid =
- poa->activate_object( &messenger_servant );
+ poa->activate_object( messenger_servant.in() );
CORBA::Object_var messenger_obj = poa->id_to_reference( oid.in() );
CORBA::String_var str = orb->object_to_string( messenger_obj.in() );
std::ofstream iorFile( "Messenger.ior" );