diff options
Diffstat (limited to 'cpp/src/qpid/broker/Connection.cpp')
-rw-r--r-- | cpp/src/qpid/broker/Connection.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/Connection.cpp b/cpp/src/qpid/broker/Connection.cpp index b1b8abe4fd..a21db0f603 100644 --- a/cpp/src/qpid/broker/Connection.cpp +++ b/cpp/src/qpid/broker/Connection.cpp @@ -94,13 +94,12 @@ void Connection::closeChannel(uint16_t id) { } SessionHandler& Connection::getChannel(ChannelId id) { - boost::optional<SessionHandler>& ch = channels[id]; - if (!ch) { - ch = boost::in_place(boost::ref(*this), id); + ChannelMap::iterator i=channels.find(id); + if (i == channels.end()) { + i = channels.insert(id, new SessionHandler(*this, id)).first; } - return *ch; + return *i; } - }} |