Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 64140 invoked from network); 29 Mar 2010 22:30:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Mar 2010 22:30:17 -0000 Received: (qmail 68860 invoked by uid 500); 29 Mar 2010 22:30:17 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 68837 invoked by uid 500); 29 Mar 2010 22:30:17 -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 68830 invoked by uid 99); 29 Mar 2010 22:30:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Mar 2010 22:30:17 +0000 X-ASF-Spam-Status: No, hits=-1182.0 required=10.0 tests=ALL_TRUSTED,AWL 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; Mon, 29 Mar 2010 22:30:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 64AEB2388900; Mon, 29 Mar 2010 22:29:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r928920 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/decaf/lang/ArrayPointer.h test/decaf/lang/ArrayPointerTest.cpp Date: Mon, 29 Mar 2010 22:29:56 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100329222956.64AEB2388900@eris.apache.org> Author: tabish Date: Mon Mar 29 22:29:56 2010 New Revision: 928920 URL: http://svn.apache.org/viewvc?rev=928920&view=rev Log: Fix a bug in the release function. Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/ArrayPointer.h activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.cpp Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/ArrayPointer.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/ArrayPointer.h?rev=928920&r1=928919&r2=928920&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/ArrayPointer.h (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/ArrayPointer.h Mon Mar 29 22:29:56 2010 @@ -181,8 +181,9 @@ namespace lang { * out of scope. */ T* release() { - T* temp = this->value; - this->array = NULL; + T* temp = this->array->value; + this->array->value = NULL; + this->array->length = 0; return temp; } Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.cpp?rev=928920&r1=928919&r2=928920&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.cpp (original) +++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.cpp Mon Mar 29 22:29:56 2010 @@ -167,6 +167,12 @@ void ArrayPointerTest::testBasics() { ArrayPointer ex( 1 ); CPPUNIT_FAIL( "Should Have Thrown." ); } catch(...) {} + + { + ArrayPointer array( 50 ); + unsigned char* buffer = array.release(); + delete [] buffer; + } } ////////////////////////////////////////////////////////////////////////////////