summaryrefslogtreecommitdiff
path: root/cppe/src/IceE/Communicator.cpp
diff options
context:
space:
mode:
authorBrent Eagles <brent@zeroc.com>2005-09-03 01:38:47 +0000
committerBrent Eagles <brent@zeroc.com>2005-09-03 01:38:47 +0000
commitb8d8de4e0fd4e31ed468db199e76b77d18daa709 (patch)
treea51c864fdf7aec48f195654a62c63835332eda49 /cppe/src/IceE/Communicator.cpp
parentremoving obvious comment (diff)
downloadice-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-xcppe/src/IceE/Communicator.cpp17
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