Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 43576 invoked from network); 7 Jul 2010 04:10:20 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Jul 2010 04:10:20 -0000 Received: (qmail 46388 invoked by uid 500); 7 Jul 2010 04:10:20 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 46330 invoked by uid 500); 7 Jul 2010 04:10:19 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 46321 invoked by uid 99); 7 Jul 2010 04:10:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jul 2010 04:10:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jul 2010 04:10:17 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3139B2388AF0; Wed, 7 Jul 2010 04:09:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100707040924.3139B2388AF0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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;