activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r946819 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp
Date Thu, 20 May 2010 23:27:12 GMT
Author: tabish
Date: Thu May 20 23:27:11 2010
New Revision: 946819

URL: http://svn.apache.org/viewvc?rev=946819&view=rev
Log:
Fix so that it builds in MS Visual Studio 2010

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp?rev=946819&r1=946818&r2=946819&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp Thu
May 20 23:27:11 2010
@@ -57,11 +57,13 @@ ByteArrayOutputStream::~ByteArrayOutputS
 ////////////////////////////////////////////////////////////////////////////////
 std::pair<unsigned char*, int> ByteArrayOutputStream::toByteArray() const {
 
+    unsigned char* temp = NULL;
+
     if( this->count == 0 ) {
-        return std::pair<unsigned char*, int>( NULL, 0 );
+        return std::pair<unsigned char*, int>( temp, 0 );
     }
 
-    unsigned char* temp = new unsigned char[this->count];
+    temp = new unsigned char[this->count];
     System::arraycopy( this->buffer, 0, temp, 0, this->count );
 
     return std::make_pair( temp, this->count );



Mime
View raw message