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/02 14:13:34 UTC

svn commit: r709878 - /activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp

Author: tabish
Date: Sun Nov  2 05:13:34 2008
New Revision: 709878

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

Fix possible memory leak

Modified:
    activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp

Modified: activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp?rev=709878&r1=709877&r2=709878&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/lang/Exception.cpp Sun Nov  2 05:13:34 2008
@@ -170,6 +170,11 @@
         return;
     }
 
+    if( this->cause != NULL ) {
+        std::cout << "Deleting old Cause" << std::endl;
+        delete this->cause;
+    }
+
     const Exception* ptrCause = dynamic_cast<const Exception*>( cause );
     if( ptrCause == NULL ) {
         this->cause = new Exception( __FILE__, __LINE__, cause->what() );