activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r711288 - /activemq/activemq-cpp/trunk/src/main/decaf/io/BufferedInputStream.cpp
Date Tue, 04 Nov 2008 16:11:23 GMT
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;
-    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////



Mime
View raw message