qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject [18/25] qpid-proton git commit: PROTON-854: remove sessions from the list when they are freed
Date Fri, 24 Apr 2015 15:20:48 GMT
PROTON-854: remove sessions from the list when they are freed

(cherry picked from commit 1e4b121d6fdbcfa5585416dfdca4430e042f52bf)


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/69fc2ebd
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/69fc2ebd
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/69fc2ebd

Branch: refs/heads/0.9.x
Commit: 69fc2ebdb0a2ae7fca797dc42c0d0185a45ec14d
Parents: b6fc285
Author: Robert Gemmell <robbie@apache.org>
Authored: Mon Apr 20 11:27:32 2015 +0100
Committer: Robert Gemmell <robbie@apache.org>
Committed: Fri Apr 24 15:48:18 2015 +0100

----------------------------------------------------------------------
 .../org/apache/qpid/proton/engine/impl/ConnectionImpl.java   | 8 +++++++-
 .../java/org/apache/qpid/proton/engine/impl/SessionImpl.java | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69fc2ebd/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
index 68907d5..17ffde7 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ConnectionImpl.java
@@ -86,6 +86,11 @@ public class ConnectionImpl extends EndpointImpl implements ProtonJConnection
         return session;
     }
 
+    void freeSession(SessionImpl session)
+    {
+        _sessions.remove(session);
+    }
+
     protected LinkNode<SessionImpl> addSessionEndpoint(SessionImpl endpoint)
     {
         LinkNode<SessionImpl> node;
@@ -190,7 +195,8 @@ public class ConnectionImpl extends EndpointImpl implements ProtonJConnection
 
     @Override
     void doFree() {
-        for(Session session : _sessions) {
+        List<SessionImpl> sessions = new ArrayList<SessionImpl>(_sessions);
+        for(Session session : sessions) {
             session.free();
         }
         _sessions = null;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/69fc2ebd/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
index 5eb55f5..0b3524a 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/SessionImpl.java
@@ -100,6 +100,7 @@ public class SessionImpl extends EndpointImpl implements ProtonJSession
 
     @Override
     void doFree() {
+        _connection.freeSession(this);
         _connection.removeSessionEndpoint(_node);
         _node = null;
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message