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/05/21 01:27:12 UTC
svn commit: r946819 -
/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp
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 );