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 2008/11/04 17:14:50 UTC

svn commit: r711291 - /activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedOutputStream.cpp

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;
-    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////