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:11:23 UTC

svn commit: r711288 - /activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.cpp

Author: tabish
Date: Tue Nov  4 08:11:22 2008
New Revision: 711288

URL: http://svn.apache.org/viewvc?rev=711288&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/BufferedInputStream.cpp

Modified: activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.cpp?rev=711288&r1=711287&r2=711288&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.cpp Tue Nov  4 08:11:22 2008
@@ -50,6 +50,12 @@
 BufferedInputStream::~BufferedInputStream() {
     try{
         this->close();
+
+        // Destroy the buffer.
+        if( buffer != NULL ){
+            delete [] buffer;
+            buffer = NULL;
+        }
     }
     DECAF_CATCH_NOTHROW( IOException )
     DECAF_CATCHALL_NOTHROW()
@@ -79,12 +85,6 @@
 
     // let parent close the inputStream
     FilterInputStream::close();
-
-    // Destroy the buffer.
-    if( buffer != NULL ){
-        delete [] buffer;
-        buffer = NULL;
-    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////