summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/ConnectRequestHandler.cpp5
-rw-r--r--cpp/src/Ice/Proxy.cpp4
2 files changed, 4 insertions, 5 deletions
diff --git a/cpp/src/Ice/ConnectRequestHandler.cpp b/cpp/src/Ice/ConnectRequestHandler.cpp
index 7a6b495a13f..5a9a84c83b1 100644
--- a/cpp/src/Ice/ConnectRequestHandler.cpp
+++ b/cpp/src/Ice/ConnectRequestHandler.cpp
@@ -92,11 +92,10 @@ RequestHandlerPtr
ConnectRequestHandler::connect()
{
Ice::ObjectPrx proxy = _proxy;
-
- _reference->getConnection(this);
-
try
{
+ _reference->getConnection(this);
+
Lock sync(*this);
if(!initialized())
{
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp
index 2d7ef940fa7..f455f5e6361 100644
--- a/cpp/src/Ice/Proxy.cpp
+++ b/cpp/src/Ice/Proxy.cpp
@@ -1644,10 +1644,10 @@ void
IceProxy::Ice::Object::__setRequestHandler(const ::IceInternal::RequestHandlerPtr& previous,
const ::IceInternal::RequestHandlerPtr& handler)
{
- if(_reference->getCacheConnection())
+ if(_reference->getCacheConnection() && previous)
{
IceUtil::Mutex::Lock sync(_mutex);
- if(_requestHandler.get() != handler.get())
+ if(_requestHandler && _requestHandler.get() != handler.get())
{
//
// Update the request handler only if "previous" is the same