diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Ice/CommunicatorI.cpp | 10 | ||||
-rw-r--r-- | cpp/test/Freeze/cursor/Client.cpp | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp index b8e9fdd0c39..168c2a02b7e 100644 --- a/cpp/src/Ice/CommunicatorI.cpp +++ b/cpp/src/Ice/CommunicatorI.cpp @@ -81,12 +81,20 @@ Ice::CommunicatorI::proxyToString(const ObjectPrx& proxy) ObjectAdapterPtr Ice::CommunicatorI::createObjectAdapter(const string& name) { + RecMutex::Lock sync(*this); + if (!_instance) + { + throw CommunicatorDestroyedException(__FILE__, __LINE__); + } + ObjectAdapterPtr adapter = createObjectAdapterFromProperty(name, "Ice.Adapter." + name + ".Endpoints"); + string router = _instance->properties()->getProperty("Ice.Adapter." + name + ".Router"); if (!router.empty()) { adapter->addRouter(RouterPrx::uncheckedCast(_instance->proxyFactory()->stringToProxy(router))); } + return adapter; } @@ -98,6 +106,7 @@ Ice::CommunicatorI::createObjectAdapterFromProperty(const string& name, const st { throw CommunicatorDestroyedException(__FILE__, __LINE__); } + string endpts = _instance->properties()->getProperty(property); return createObjectAdapterWithEndpoints(name, endpts); } @@ -110,6 +119,7 @@ Ice::CommunicatorI::createObjectAdapterWithEndpoints(const string& name, const s { throw CommunicatorDestroyedException(__FILE__, __LINE__); } + return _instance->objectAdapterFactory()->createObjectAdapter(name, endpts); } diff --git a/cpp/test/Freeze/cursor/Client.cpp b/cpp/test/Freeze/cursor/Client.cpp index c612a5a23fd..7ee9d25e6bf 100644 --- a/cpp/test/Freeze/cursor/Client.cpp +++ b/cpp/test/Freeze/cursor/Client.cpp @@ -295,7 +295,7 @@ run(int argc, char* argv[], const DBEnvironmentPtr& dbEnv) cursor->close(); clone->close(); - cout << " ok" << endl; + cout << "ok" << endl; db->close(); return EXIT_SUCCESS; |