You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2010/07/07 06:09:24 UTC
svn commit: r961138 -
/activemq/sandbox/activemq-apollo-actor/activemq-tcp/src/main/java/org/apache/activemq/transport/tcp/TcpTransport.java
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;