activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r711291 - /activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.cpp
Date Tue, 04 Nov 2008 16:14:50 GMT
Author: tabish
Date: Tue Nov  4 08:14:49 2008
New Revision: 711291

URL: http://svn.apache.org/viewvc?rev=711291&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-200

Move deletion of buffer to the destructor, not the close method.

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

Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.cpp?rev=711291&r1=711290&r2=711291&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.cpp Tue Nov  4 08:14:49
2008
@@ -50,6 +50,12 @@
 BufferedOutputStream::~BufferedOutputStream() {
     try{
         this->close();
+
+        // Destroy the buffer.
+        if( buffer != NULL ){
+            delete [] buffer;
+            buffer = NULL;
+        }
     }
     DECAF_CATCH_NOTHROW( IOException )
     DECAF_CATCHALL_NOTHROW()
@@ -75,12 +81,6 @@
 
     // let parent close the inputStream
     FilterOutputStream::close();
-
-    // Destroy the buffer.
-    if( buffer != NULL ){
-        delete [] buffer;
-        buffer = NULL;
-    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////



Mime
View raw message