summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/ConnectionImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/client/ConnectionImpl.cpp')
-rw-r--r--cpp/src/qpid/client/ConnectionImpl.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/cpp/src/qpid/client/ConnectionImpl.cpp b/cpp/src/qpid/client/ConnectionImpl.cpp
index 67ae2293f1..bdafa795c2 100644
--- a/cpp/src/qpid/client/ConnectionImpl.cpp
+++ b/cpp/src/qpid/client/ConnectionImpl.cpp
@@ -52,7 +52,6 @@ ConnectionImpl::ConnectionImpl(framing::ProtocolVersion v, const ConnectionSetti
connector.setTimeoutHandler(this);
connector.setShutdownHandler(this);
- open(settings.host, settings.port);
//only set error handler once open
handler.onError = boost::bind(&ConnectionImpl::closed, this, _1, _2);
}
@@ -135,11 +134,13 @@ ConnectionImpl::SessionVector ConnectionImpl::closeInternal(const Mutex::ScopedL
}
void ConnectionImpl::closed(uint16_t code, const std::string& text)
-{
- Mutex::ScopedLock l(lock);
- if (isClosed) return;
- SessionVector save(closeInternal(l));
- Mutex::ScopedUnlock u(lock);
+{
+ SessionVector save;
+ {
+ Mutex::ScopedLock l(lock);
+ if (isClosed) return;
+ save = closeInternal(l);
+ }
std::for_each(save.begin(), save.end(), boost::bind(&SessionImpl::connectionClosed, _1, code, text));
}