You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2015/06/03 18:04:07 UTC
svn commit: r1683379 -
/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Connection.cpp
Author: kgiusti
Date: Wed Jun 3 16:04:07 2015
New Revision: 1683379
URL: http://svn.apache.org/r1683379
Log:
QPID-6563: free sessions and links that have completely closed
Modified:
qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Connection.cpp
Modified: qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Connection.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Connection.cpp?rev=1683379&r1=1683378&r2=1683379&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Connection.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/amqp/Connection.cpp Wed Jun 3 16:04:07 2015
@@ -442,10 +442,14 @@ void Connection::process()
processDeliveries();
- for (pn_link_t* l = pn_link_head(connection, REQUIRES_CLOSE); l; l = pn_link_next(l, REQUIRES_CLOSE)) {
+ for (pn_link_t* l = pn_link_head(connection, REQUIRES_CLOSE), *next = 0;
+ l; l = next) {
+ next = pn_link_next(l, REQUIRES_CLOSE);
doLinkRemoteClose(l);
}
- for (pn_session_t* s = pn_session_head(connection, REQUIRES_CLOSE); s; s = pn_session_next(s, REQUIRES_CLOSE)) {
+ for (pn_session_t* s = pn_session_head(connection, REQUIRES_CLOSE), *next = 0;
+ s; s = next) {
+ next = pn_session_next(s, REQUIRES_CLOSE);
doSessionRemoteClose(s);
}
if ((pn_connection_state(connection) & REQUIRES_CLOSE) == REQUIRES_CLOSE) {
@@ -537,6 +541,7 @@ void Connection::doSessionRemoteClose(pn
QPID_LOG(error, id << " peer attempted to close unrecognised session");
}
}
+ pn_session_free(session);
}
// the peer has issued an Attach performative
@@ -587,6 +592,7 @@ void Connection::doLinkRemoteClose(pn_li
QPID_LOG_CAT(debug, model, id << " link detached");
}
}
+ pn_link_free(link);
}
// the status of the delivery has changed
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org