activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r506678 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire: OpenWireCommandReader.cpp OpenWireCommandWriter.cpp OpenWireFormat.cpp OpenWireFormatNegotiator.cpp
Date Mon, 12 Feb 2007 21:50:37 GMT
Author: nmittler
Date: Mon Feb 12 13:50:36 2007
New Revision: 506678

URL: http://svn.apache.org/viewvc?view=rev&rev=506678
Log:
[AMQCPP-30] Fixed memory leak in OpenWireCommandReader/Writer

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireCommandReader.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireCommandWriter.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireCommandReader.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireCommandReader.cpp?view=diff&rev=506678&r1=506677&r2=506678
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireCommandReader.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireCommandReader.cpp
Mon Feb 12 13:50:36 2007
@@ -18,6 +18,7 @@
 #include "OpenWireCommandReader.h"
 
 #include <activemq/concurrent/Thread.h>
+#include <iostream>
 
 using namespace std;
 using namespace activemq;
@@ -29,7 +30,7 @@
 using namespace activemq::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-OpenWireCommandReader::OpenWireCommandReader(void)
+OpenWireCommandReader::OpenWireCommandReader()
 {
     this->inputStream = NULL;
     this->openWireFormat = NULL;
@@ -45,7 +46,15 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-Command* OpenWireCommandReader::readCommand(void)
+OpenWireCommandReader::~OpenWireCommandReader() {
+    
+    if( dataInputStream != NULL ) {
+        delete dataInputStream;
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Command* OpenWireCommandReader::readCommand()
     throw ( CommandIOException )
 {
     try
@@ -87,7 +96,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-unsigned char OpenWireCommandReader::readByte(void) throw( io::IOException )
+unsigned char OpenWireCommandReader::readByte() throw( io::IOException )
 {
     try
     {

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireCommandWriter.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireCommandWriter.cpp?view=diff&rev=506678&r1=506677&r2=506678
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireCommandWriter.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireCommandWriter.cpp
Mon Feb 12 13:50:36 2007
@@ -16,6 +16,7 @@
  */
 
 #include "OpenWireCommandWriter.h"
+#include <iostream>
 
 using namespace std;
 using namespace activemq;
@@ -26,7 +27,7 @@
 using namespace activemq::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-OpenWireCommandWriter::OpenWireCommandWriter(void)
+OpenWireCommandWriter::OpenWireCommandWriter()
 {
     this->outputStream = NULL;
     this->openWireFormat = NULL;
@@ -39,6 +40,14 @@
 {
     this->setOutputStream( outputStream );
     this->openWireFormat = openWireFormat;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+OpenWireCommandWriter::~OpenWireCommandWriter() {
+    
+    if( dataOutputStream != NULL ) {
+        delete dataOutputStream;
+    }
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp?view=diff&rev=506678&r1=506677&r2=506678
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormat.cpp
Mon Feb 12 13:50:36 2007
@@ -29,6 +29,7 @@
 #include <activemq/connector/openwire/marshal/MarshalAware.h>
 #include <activemq/connector/openwire/marshal/DataStreamMarshaller.h>
 #include <activemq/connector/openwire/marshal/v2/MarshallerFactory.h>
+#include <iostream>
 
 using namespace std;
 using namespace activemq;
@@ -199,6 +200,9 @@
     throw ( io::IOException ) {
 
     try{
+        
+        cout << "OpenWireFormat::unmarshal()" << endl;
+        cout.flush();
 
         if( !sizePrefixDisabled ) {
             dis->readInt();

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.cpp?view=diff&rev=506678&r1=506677&r2=506678
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/OpenWireFormatNegotiator.cpp
Mon Feb 12 13:50:36 2007
@@ -19,7 +19,9 @@
 
 #include <activemq/connector/openwire/commands/DataStructure.h>
 #include <activemq/connector/openwire/commands/WireFormatInfo.h>
+#include <iostream>
 
+using namespace std;
 using namespace activemq;
 using namespace activemq::exceptions;
 using namespace activemq::transport;
@@ -81,6 +83,9 @@
 ////////////////////////////////////////////////////////////////////////////////
 void OpenWireFormatNegotiator::onCommand( Command* command ) {
 
+    cout << "OpenWireFormatNegotiator::onCommand" << endl;
+    cout.flush();
+    
     DataStructure* dataStructure =
         dynamic_cast<DataStructure*>( command );
 
@@ -177,6 +182,9 @@
 
             // Mark the latch
             wireInfoSentDownLatch.countDown();
+            
+            cout << "leaving OpenWireFormatNegotiator::start first time logic" <<
endl;
+            cout.flush();
 
         } catch( ActiveMQException& ex ) {
 



Mime
View raw message