You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2010/01/22 21:29:37 UTC

svn commit: r902255 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/decaf/lang/Pointer.h test/decaf/lang/PointerTest.cpp

Author: tabish
Date: Fri Jan 22 20:29:37 2010
New Revision: 902255

URL: http://svn.apache.org/viewvc?rev=902255&view=rev
Log:
Fix for http://issues.apache.org/activemq/browse/AMQCPP-281

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/PointerTest.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h?rev=902255&r1=902254&r2=902255&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/Pointer.h Fri Jan 22 20:29:37 2010
@@ -174,9 +174,10 @@
                 REFCOUNTER( value ), value( dynamic_cast<T*>( value.get() ) ), onDelete( onDeleteFunc ) {
 
             if( this->value == NULL ) {
+
                 // Remove the reference we took in the Reference Counter's ctor since we
-                // didn't actually create one as the dynamic cast failed..
-                this->release();
+                // didn't actually create one as the dynamic cast failed.
+                REFCOUNTER::release();
                 throw decaf::lang::exceptions::ClassCastException(
                     __FILE__, __LINE__,
                     "Failed to cast source pointer of type %s to this type: %s.",

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/PointerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/PointerTest.cpp?rev=902255&r1=902254&r2=902255&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/PointerTest.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/PointerTest.cpp Fri Jan 22 20:29:37 2010
@@ -461,7 +461,6 @@
         "Should Throw a ClassCastException",
         ptrTestClassA2 = nullPointer.dynamicCast<TestClassA>(),
         ClassCastException );
-
 }
 
 ////////////////////////////////////////////////////////////////////////////////