diff options
author | Brent Eagles <brent@zeroc.com> | 2005-09-03 01:38:47 +0000 |
---|---|---|
committer | Brent Eagles <brent@zeroc.com> | 2005-09-03 01:38:47 +0000 |
commit | b8d8de4e0fd4e31ed468db199e76b77d18daa709 (patch) | |
tree | a51c864fdf7aec48f195654a62c63835332eda49 /cppe/src/IceE/Communicator.cpp | |
parent | removing obvious comment (diff) | |
download | ice-b8d8de4e0fd4e31ed468db199e76b77d18daa709.tar.bz2 ice-b8d8de4e0fd4e31ed468db199e76b77d18daa709.tar.xz ice-b8d8de4e0fd4e31ed468db199e76b77d18daa709.zip |
fix for bug 431, attempt to create object adapters with identical ids
throws an exception
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 |