axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject svn commit: r368035 - /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
Date Wed, 11 Jan 2006 15:09:34 GMT
Author: dicka
Date: Wed Jan 11 07:09:31 2006
New Revision: 368035

URL: http://svn.apache.org/viewcvs?rev=368035&view=rev
Log:
Resolve memory leak in complex types containing arrays of complex types.
Ensure deepcopy flag is set correctly for string-based simple types within complex types,
to prevent attempting to delete unallocated memory.

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

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java?rev=368035&r1=368034&r2=368035&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
Wed Jan 11 07:09:31 2006
@@ -863,25 +863,6 @@
             return;
         }
         String arrayType = null;
-
-//        /* Needed for Aix xlc */
-//
-//        for (int i = 0; i < attribs.length; i++)
-//        {
-//            if (attribs[i].isArray())
-//            {
-//                if (attribs[i].isSimpleType())
-//                {
-//                    writer.write("\tAxis_Array * array;\n\n");
-//                }
-//                else
-//                {
-//                    writer.write("\t" + attribs[i].getTypeName() + "_Array * array = new
" + attribs[i].getTypeName() + "_Array();\n\n");
-//                }
-//                break;
-//            }
-//        }
-
         boolean peekCalled = false;
         boolean firstIfWritten = false;
         boolean foundAll = false;
@@ -972,8 +953,7 @@
                 else
                 {
                     arrayType = attribs[i].getTypeName();
-                    writer.write("\t" + arrayType + "_Array * array" + arrayCount + " = new
" + arrayType + "_Array();\n");
-                    writer.write("\tarray" + arrayCount + " = (" + arrayType + "_Array *)
pIWSDZ->getCmplxArray(array" + arrayCount + ", (void*)Axis_DeSerialize_"
+                    writer.write("\tpIWSDZ->getCmplxArray(param->" + attribs[i].getParamNameAsMember()
+ ", (void*)Axis_DeSerialize_"
                                     + arrayType
                                     + ",\n"
                                     + "\t\t\t\t\t\t\t\t  (void*)Axis_Create_"
@@ -989,7 +969,6 @@
                                     + attribs[i].getElementNameAsString()
                                     + "\", Axis_URI_" + arrayType + ");\n\n");
                     
-                	writer.write("\tparam->" + attribs[i].getParamNameAsMember() + " = array"
+ arrayCount + ";\n\n");
                 }
             }
             else if (attribs[i].isSimpleType())
@@ -1069,13 +1048,6 @@
                 		writer.write( "\t\t\telse\n");
                 		writer.write( "\t\t\t{\n");
                 		
-                		if( CUtils.isPointerType( typeName))
-                		{
-                		    writer.write("\t\t\t\tparam->" + elementName + " = new char[strlen(
pValue" + i + ") + 1];\n");
-                    		writer.write("\t\t\t\tstrcpy( param->" + elementName + ", pValue"
+ i + ");\n\n");
-                		}
-                		else
-                		{
                 			String localElemName = elementName;
                 			if( elementName.endsWith( "_"))
                             {
@@ -1084,7 +1056,6 @@
                             }
                 			
                 			writer.write("\t\t\t\tparam->set" + localElemName + " (pValue" + i
+ ");\n");
-                		}
                 		
                 		writer.write("\t\t\t\tAxis::AxisDelete( (void *) pValue" + i + ", " + CUtils.getXSDTypeForBasicType(
typeName) + ");\n\n");
 
@@ -1408,6 +1379,7 @@
                     if(CUtils.isPointerType(attribs[i].getTypeName()))
                     {
                         writer.write("\t"+ attribs[i].getParamNameAsMember() + " = NULL;\n");
+                        writer.write("\t__axis_deepcopy_" + attribs[i].getParamName() + "
= false;\n");
                     }
                 }
             }



Mime
View raw message