diff options
Diffstat (limited to 'cpp/src/IceDiscovery/PluginI.cpp')
-rw-r--r-- | cpp/src/IceDiscovery/PluginI.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cpp/src/IceDiscovery/PluginI.cpp b/cpp/src/IceDiscovery/PluginI.cpp index 37992bdab35..1a76f34ff06 100644 --- a/cpp/src/IceDiscovery/PluginI.cpp +++ b/cpp/src/IceDiscovery/PluginI.cpp @@ -148,7 +148,8 @@ PluginI::initialize() // Ice::ObjectPrxPtr loc = _locatorAdapter->addWithUUID(ICE_MAKE_SHARED(LocatorI, _lookup, locatorRegistryPrx)); _defaultLocator = _communicator->getDefaultLocator(); - _communicator->setDefaultLocator(ICE_UNCHECKED_CAST(Ice::LocatorPrx, loc)); + _locator = ICE_UNCHECKED_CAST(Ice::LocatorPrx, loc); + _communicator->setDefaultLocator(_locator); _multicastAdapter->activate(); _replyAdapter->activate(); @@ -162,5 +163,9 @@ PluginI::destroy() _replyAdapter->destroy(); _locatorAdapter->destroy(); _lookup->destroy(); - _communicator->setDefaultLocator(_defaultLocator); + // Restore original default locator proxy, if the user didn't change it in the meantime. + if(_communicator->getDefaultLocator() == _locator) + { + _communicator->setDefaultLocator(_defaultLocator); + } } |