summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/info/Server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/info/Server.cpp')
-rw-r--r--cpp/test/Ice/info/Server.cpp27
1 files changed, 4 insertions, 23 deletions
diff --git a/cpp/test/Ice/info/Server.cpp b/cpp/test/Ice/info/Server.cpp
index 44f093f568e..5d811ef4609 100644
--- a/cpp/test/Ice/info/Server.cpp
+++ b/cpp/test/Ice/info/Server.cpp
@@ -20,7 +20,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator)
{
communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp -p 12010");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
- adapter->add(new TestI, communicator->stringToIdentity("test"));
+ adapter->add(ICE_MAKE_SHARED(TestI), communicator->stringToIdentity("test"));
adapter->activate();
TEST_READY
communicator->waitForShutdown();
@@ -33,34 +33,15 @@ main(int argc, char* argv[])
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
#endif
- int status;
- Ice::CommunicatorPtr communicator;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
- communicator = Ice::initialize(argc, argv, initData);
- status = run(argc, argv, communicator);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
- status = EXIT_FAILURE;
+ return EXIT_FAILURE;
}
-
- if(communicator)
- {
- try
- {
- communicator->destroy();
- }
- catch(const Ice::Exception& ex)
- {
- cerr << ex << endl;
- status = EXIT_FAILURE;
- }
- }
-
- return status;
}