activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r743116 [2/2] - in /activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main: activemq/connector/openwire/commands/ java/org/apache/activemq/openwire/tool/
Date Tue, 10 Feb 2009 21:52:15 GMT
Modified: activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java?rev=743116&r1=743115&r2=743116&view=diff
==============================================================================
--- activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java
(original)
+++ activemq/activemq-cpp/branches/activemq-cpp-2.x/src/main/java/org/apache/activemq/openwire/tool/AmqCppClassesGenerator.java
Tue Feb 10 21:52:14 2009
@@ -155,6 +155,7 @@
 out.println("#include <activemq/connector/openwire/commands/"+className+".h>");
 out.println("#include <activemq/exceptions/ActiveMQException.h>");
 out.println("#include <decaf/lang/exceptions/NullPointerException.h>");
+out.println("#include <memory>");
 out.println("");
 out.println("using namespace std;");
 out.println("using namespace activemq;");
@@ -223,12 +224,12 @@
 
     String newInstance = decapitalize( className );
 
-out.println("    "+className+"* "+newInstance+" = new "+className+"();");
+out.println("    std::auto_ptr<"+className+"> "+newInstance+"( new "+className+"()
);");
 out.println("");
 out.println("    // Copy the data from the base class or classes");
 out.println("    "+newInstance+"->copyDataStructure( this );");
 out.println("");
-out.println("    return "+newInstance+";");
+out.println("    return "+newInstance+".release();");
 out.println("}");
 
 out.println("");



Mime
View raw message