Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 91809 invoked from network); 2 Jun 2007 22:21:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jun 2007 22:21:12 -0000 Received: (qmail 57468 invoked by uid 500); 2 Jun 2007 22:21:16 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 57436 invoked by uid 500); 2 Jun 2007 22:21:16 -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 57427 invoked by uid 99); 2 Jun 2007 22:21:16 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jun 2007 15:21:16 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jun 2007 15:21:12 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 6D57D1A981A; Sat, 2 Jun 2007 15:20:51 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r543795 - /activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp Date: Sat, 02 Jun 2007 22:20:51 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070602222051.6D57D1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Sat Jun 2 15:20:49 2007 New Revision: 543795 URL: http://svn.apache.org/viewvc?view=rev&rev=543795 Log: https://issues.apache.org/activemq/browse/AMQCPP-119 return "" on class to getClientId after connection is closed Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp Modified: activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp?view=diff&rev=543795&r1=543794&r2=543795 ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/core/ActiveMQConnection.cpp Sat Jun 2 15:20:49 2007 @@ -94,7 +94,6 @@ { try { - // Create the session instance. ActiveMQSession* session = new ActiveMQSession( connectionData->getConnector()->createSession( ackMode ), @@ -120,7 +119,11 @@ //////////////////////////////////////////////////////////////////////////////// std::string ActiveMQConnection::getClientID() const { - return connectionData->getConnector()->getClientId(); + if( closed ) { + return ""; + } + + return connectionData->getConnector()->getClientId(); } //////////////////////////////////////////////////////////////////////////////// @@ -210,20 +213,20 @@ fire( ex ); return; - } + } // Look up the dispatcher. Dispatcher* dispatcher = NULL; synchronized( &dispatchers ) { dispatcher = dispatchers.getValue(consumer->getConsumerId()); - + // If we have no registered dispatcher, the consumer was probably // just closed. Just delete the message. - if( dispatcher == NULL ) { - delete message; + if( dispatcher == NULL ) { + delete message; } else { - + // Dispatch the message. DispatchData data( consumer, message ); dispatcher->dispatch( data );