axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject svn commit: r368053 - /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
Date Wed, 11 Jan 2006 16:16:16 GMT
Author: dicka
Date: Wed Jan 11 08:16:13 2006
New Revision: 368053

URL: http://svn.apache.org/viewcvs?rev=368053&view=rev
Log:
Resolve memory leak when throwing faults from generated stubs.

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java?rev=368053&r1=368052&r2=368053&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
Wed Jan 11 08:16:13 2006
@@ -1403,7 +1403,18 @@
 		("\t\t\t\tpFaultDetail->setExceptionCode(e.getExceptionCode());\n");
 	    writer.write ("\t\t\t\tm_pCall->unInitialize();\n");
 	    writer.write ("\t\t\t\tdelete pSoapFault;\n");
-	    writer.write ("\t\t\t\tthrow *pFaultDetail;\n");
+	    String faultTypeName;
+	    if (faulttype.lastIndexOf('*') != -1)
+	    {
+	        faultTypeName = faulttype.substring(0, faulttype.lastIndexOf('*'));
+	    }
+	    else
+	    {
+	        faultTypeName = faulttype;
+	    }
+	    writer.write ("\t\t\t\t" + faultTypeName + " fault = *pFaultDetail;\n");
+	    writer.write ("\t\t\t\tdelete pFaultDetail;\n");
+	    writer.write ("\t\t\t\tthrow fault;\n");
 	    writer.write ("\t\t\t}\n");
 	}
 	catch (IOException e)



Mime
View raw message