summaryrefslogtreecommitdiff
path: root/cpp/src/IceDiscovery/PluginI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-11-25 11:51:58 +0100
committerBenoit Foucher <benoit@zeroc.com>2014-11-25 11:51:58 +0100
commit60e2d367a2f249a10b406ca56929787c7cc7c4cc (patch)
treeff2bec97e9de12dcf11bbc473e9f1d856d52aba0 /cpp/src/IceDiscovery/PluginI.cpp
parentFixed ICE-5978 & ICE-5973: ACM test failures (diff)
downloadice-60e2d367a2f249a10b406ca56929787c7cc7c4cc.tar.bz2
ice-60e2d367a2f249a10b406ca56929787c7cc7c4cc.tar.xz
ice-60e2d367a2f249a10b406ca56929787c7cc7c4cc.zip
Fix for ICE-5970: use smart pointer instead of raw pointer for the lookup object
Diffstat (limited to 'cpp/src/IceDiscovery/PluginI.cpp')
-rw-r--r--cpp/src/IceDiscovery/PluginI.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp/src/IceDiscovery/PluginI.cpp b/cpp/src/IceDiscovery/PluginI.cpp
index ab9482cc1ce..f62b61e955a 100644
--- a/cpp/src/IceDiscovery/PluginI.cpp
+++ b/cpp/src/IceDiscovery/PluginI.cpp
@@ -121,16 +121,16 @@ PluginI::initialize()
//
// Add lookup and lookup reply Ice objects
//
- LookupIPtr lookup = new LookupI(locatorRegistry, LookupPrx::uncheckedCast(lookupPrx), properties);
- _multicastAdapter->add(lookup, _communicator->stringToIdentity("IceDiscovery/Lookup"));
+ _lookup = new LookupI(locatorRegistry, LookupPrx::uncheckedCast(lookupPrx), properties);
+ _multicastAdapter->add(_lookup, _communicator->stringToIdentity("IceDiscovery/Lookup"));
- Ice::ObjectPrx lookupReply = _replyAdapter->addWithUUID(new LookupReplyI(lookup))->ice_datagram();
- lookup->setLookupReply(LookupReplyPrx::uncheckedCast(lookupReply));
+ Ice::ObjectPrx lookupReply = _replyAdapter->addWithUUID(new LookupReplyI(_lookup))->ice_datagram();
+ _lookup->setLookupReply(LookupReplyPrx::uncheckedCast(lookupReply));
//
// Setup locator on the communicator.
//
- Ice::ObjectPrx loc = _locatorAdapter->addWithUUID(new LocatorI(lookup, locatorRegistryPrx));
+ Ice::ObjectPrx loc = _locatorAdapter->addWithUUID(new LocatorI(_lookup, locatorRegistryPrx));
_communicator->setDefaultLocator(Ice::LocatorPrx::uncheckedCast(loc));
_multicastAdapter->activate();
@@ -144,4 +144,5 @@ PluginI::destroy()
_multicastAdapter->destroy();
_replyAdapter->destroy();
_locatorAdapter->destroy();
+ _lookup->destroy();
}