diff options
Diffstat (limited to 'cppe/src/IceE/Communicator.cpp')
-rwxr-xr-x | cppe/src/IceE/Communicator.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/cppe/src/IceE/Communicator.cpp b/cppe/src/IceE/Communicator.cpp index cb5a33698b0..9e57ecbdb45 100755 --- a/cppe/src/IceE/Communicator.cpp +++ b/cppe/src/IceE/Communicator.cpp @@ -143,8 +143,21 @@ Ice::Communicator::createObjectAdapter(const string& name) ObjectAdapterPtr Ice::Communicator::createObjectAdapterWithEndpoints(const string& name, const string& endpoints) { - getProperties()->setProperty(name + ".Endpoints", endpoints); - return createObjectAdapter(name); + const string propertyKey = name + ".Endpoints"; + const string originalValue = getProperties()->getProperty(propertyKey); + try + { + getProperties()->setProperty(propertyKey, endpoints); + return createObjectAdapter(name); + } + catch(const AlreadyRegisteredException&) + { + if(originalValue.length() != 0) + { + getProperties()->setProperty(propertyKey, originalValue); + } + throw; + } } #endif |