diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-05-10 21:52:54 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-05-10 21:52:54 +0200 |
commit | 721d887e81382cdaf7f0efde3c243684aa1918b2 (patch) | |
tree | bc39ef27d129373682a2548bf0ec4f235ac1ab0a /java-compat/src | |
parent | Fix Makefile indentation (diff) | |
download | ice-721d887e81382cdaf7f0efde3c243684aa1918b2.tar.bz2 ice-721d887e81382cdaf7f0efde3c243684aa1918b2.tar.xz ice-721d887e81382cdaf7f0efde3c243684aa1918b2.zip |
Fixed ICE-7869 - IceGridGUI NPE
Diffstat (limited to 'java-compat/src')
-rw-r--r-- | java-compat/src/IceDiscovery/src/main/java/IceDiscovery/PluginI.java | 20 | ||||
-rw-r--r-- | java-compat/src/IceLocatorDiscovery/src/main/java/IceLocatorDiscovery/PluginI.java | 15 |
2 files changed, 26 insertions, 9 deletions
diff --git a/java-compat/src/IceDiscovery/src/main/java/IceDiscovery/PluginI.java b/java-compat/src/IceDiscovery/src/main/java/IceDiscovery/PluginI.java index 748a2ae83a8..61bf4f0e6a4 100644 --- a/java-compat/src/IceDiscovery/src/main/java/IceDiscovery/PluginI.java +++ b/java-compat/src/IceDiscovery/src/main/java/IceDiscovery/PluginI.java @@ -86,7 +86,8 @@ public class PluginI implements Ice.Plugin _locatorAdapter.addWithUUID(locatorRegistry)); Ice.ObjectPrx lookupPrx = _communicator.stringToProxy("IceDiscovery/Lookup -d:" + lookupEndpoints); - lookupPrx = lookupPrx.ice_collocationOptimized(false); // No collocation optimization for the multicast proxy! + // No collocation optimization for the multicast proxy! + lookupPrx = lookupPrx.ice_collocationOptimized(false).ice_router(null); // // Add lookup and lookup reply Ice objects @@ -114,12 +115,21 @@ public class PluginI implements Ice.Plugin public void destroy() { - _multicastAdapter.destroy(); - _replyAdapter.destroy(); - _locatorAdapter.destroy(); - // Restore original default locator proxy, if the user didn't change it in the meantime + if(_multicastAdapter != null) + { + _multicastAdapter.destroy(); + } + if(_replyAdapter != null) + { + _replyAdapter.destroy(); + } + if(_locatorAdapter != null) + { + _locatorAdapter.destroy(); + } if(_communicator.getDefaultLocator().equals(_locator)) { + // Restore original default locator proxy, if the user didn't change it in the meantime _communicator.setDefaultLocator(_defaultLocator); } } diff --git a/java-compat/src/IceLocatorDiscovery/src/main/java/IceLocatorDiscovery/PluginI.java b/java-compat/src/IceLocatorDiscovery/src/main/java/IceLocatorDiscovery/PluginI.java index 571a840c975..276c8433242 100644 --- a/java-compat/src/IceLocatorDiscovery/src/main/java/IceLocatorDiscovery/PluginI.java +++ b/java-compat/src/IceLocatorDiscovery/src/main/java/IceLocatorDiscovery/PluginI.java @@ -611,7 +611,8 @@ class PluginI implements Plugin _locatorAdapter.setLocator(null); Ice.ObjectPrx lookupPrx = _communicator.stringToProxy("IceLocatorDiscovery/Lookup -d:" + lookupEndpoints); - lookupPrx = lookupPrx.ice_collocationOptimized(false); // No collocation optimization for the multicast proxy! + // No collocation optimization or router for the multicast proxy! + lookupPrx = lookupPrx.ice_collocationOptimized(false).ice_router(null); Ice.LocatorPrx voidLoc = Ice.LocatorPrxHelper.uncheckedCast(_locatorAdapter.addWithUUID(new VoidLocatorI())); @@ -635,11 +636,17 @@ class PluginI implements Plugin public void destroy() { - _replyAdapter.destroy(); - _locatorAdapter.destroy(); - // Restore original default locator proxy, if the user didn't change it in the meantime + if(_replyAdapter != null) + { + _replyAdapter.destroy(); + } + if(_locatorAdapter != null) + { + _locatorAdapter.destroy(); + } if(_communicator.getDefaultLocator().equals(_locatorPrx)) { + // Restore original default locator proxy, if the user didn't change it in the meantime _communicator.setDefaultLocator(_defaultLocator); } } |