summaryrefslogtreecommitdiff
path: root/csharp/src/IceDiscovery/PluginI.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/IceDiscovery/PluginI.cs')
-rw-r--r--csharp/src/IceDiscovery/PluginI.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/csharp/src/IceDiscovery/PluginI.cs b/csharp/src/IceDiscovery/PluginI.cs
index f2e877569ad..f39e13a3939 100644
--- a/csharp/src/IceDiscovery/PluginI.cs
+++ b/csharp/src/IceDiscovery/PluginI.cs
@@ -114,7 +114,8 @@ namespace IceDiscovery
loc = _locatorAdapter.addWithUUID(
new LocatorI(lookup, Ice.LocatorRegistryPrxHelper.uncheckedCast(locatorRegistryPrx)));
_defaultLocator = _communicator.getDefaultLocator();
- _communicator.setDefaultLocator(Ice.LocatorPrxHelper.uncheckedCast(loc));
+ _locator = Ice.LocatorPrxHelper.uncheckedCast(loc);
+ _communicator.setDefaultLocator(_locator);
_multicastAdapter.activate();
_replyAdapter.activate();
@@ -126,13 +127,18 @@ namespace IceDiscovery
_multicastAdapter.destroy();
_replyAdapter.destroy();
_locatorAdapter.destroy();
- _communicator.setDefaultLocator(_defaultLocator);
+ // Restore original default locator proxy, if the user didn't change it in the meantime
+ if(_communicator.getDefaultLocator().Equals(_locator))
+ {
+ _communicator.setDefaultLocator(_defaultLocator);
+ }
}
private Ice.Communicator _communicator;
private Ice.ObjectAdapter _multicastAdapter;
private Ice.ObjectAdapter _replyAdapter;
private Ice.ObjectAdapter _locatorAdapter;
+ private Ice.LocatorPrx _locator;
private Ice.LocatorPrx _defaultLocator;
}