activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r961138 - /activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
Date Wed, 07 Jul 2010 04:09:24 GMT
Author: chirino
Date: Wed Jul  7 04:09:23 2010
New Revision: 961138

URL: http://svn.apache.org/viewvc?rev=961138&view=rev
Log:
Fix npe which occurs when conneciton is closed before it finished connecting

Modified:
    activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java

Modified: activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java?rev=961138&r1=961137&r2=961138&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
(original)
+++ activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
Wed Jul  7 04:09:23 2010
@@ -337,15 +337,16 @@ public class TcpTransport extends BaseSe
 
     private void dispose() {
 
-//        OneWay oneWay = outbound.poll();
-//        while (oneWay != null) {
-//            if (oneWay.retained != null) {
-//                oneWay.retained.release();
-//            }
-//            oneWay = outbound.poll();
-//        }
-        readSource.release();
-        writeSource.release();
+        if( readSource!=null ) {
+            readSource.release();
+            readSource=null;
+        }
+
+        if( writeSource!=null ) {
+            writeSource.release();
+            writeSource=null;
+        }
+        
         dispatchQueue.release();
         next_outbound_buffer = null;
         outbound_buffer = null;



Mime
View raw message