axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp BeanParamWriter.java ClientStubWriter.java
Date Tue, 08 Mar 2005 08:41:58 GMT
samisa      2005/03/08 00:41:58

  Modified:    c/src/soap SoapDeSerializer.cpp
               c/src/soap/xsd Int.cpp Long.cpp
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp
                        BeanParamWriter.java ClientStubWriter.java
  Log:
  Fixed memory leak problems for RPC style code
  AXISCPP-507
  
  Revision  Changes    Path
  1.152     +3 -2      ws-axis/c/src/soap/SoapDeSerializer.cpp
  
  Index: SoapDeSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.cpp,v
  retrieving revision 1.151
  retrieving revision 1.152
  diff -u -r1.151 -r1.152
  --- SoapDeSerializer.cpp	4 Mar 2005 17:03:11 -0000	1.151
  +++ SoapDeSerializer.cpp	8 Mar 2005 08:41:56 -0000	1.152
  @@ -1051,8 +1051,9 @@
       m_pNode = m_pParser->next(true); /* charactor node */\
       if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))\
       {\
  -        ((cpp_type*)Array.m_Array)[nIndex] = \
  -        *conv_func(m_pNode->m_pchNameOrValue);\
  +        cpp_type* pr = conv_func(m_pNode->m_pchNameOrValue); \
  +        ((cpp_type*)Array.m_Array)[nIndex] = *pr;\
  +        delete pr;\
           m_pNode = m_pParser->next(); /* skip end element node too */\
           continue;\
       }\
  
  
  
  1.11      +1 -0      ws-axis/c/src/soap/xsd/Int.cpp
  
  Index: Int.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Int.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Int.cpp	4 Mar 2005 13:51:40 -0000	1.10
  +++ Int.cpp	8 Mar 2005 08:41:57 -0000	1.11
  @@ -37,6 +37,7 @@
       }
       m_Int = new xsd__int;
       *m_Int = static_cast<xsd__int> (*returnValue);
  +    delete returnValue; // Samissa - need to clean this memory
       return m_Int;
   }
   
  
  
  
  1.7       +1 -0      ws-axis/c/src/soap/xsd/Long.cpp
  
  Index: Long.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/Long.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Long.cpp	4 Mar 2005 13:51:40 -0000	1.6
  +++ Long.cpp	8 Mar 2005 08:41:57 -0000	1.7
  @@ -38,6 +38,7 @@
       }
       m_Long = new xsd__long;
       *m_Long = static_cast<xsd__long> (*returnValue);
  +    delete returnValue; // Samissa - need to clean this memory
       return m_Long;
   }
   
  
  
  
  1.35      +27 -20    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
  
  Index: BeanParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- BeanParamWriter.java	22 Feb 2005 14:14:49 -0000	1.34
  +++ BeanParamWriter.java	8 Mar 2005 08:41:57 -0000	1.35
  @@ -450,16 +450,19 @@
   								|| attribs[i].getTypeName().equals("xsd__notation"))
                       	{
   	                        //TODO handle optional attributes
  -	                        writer.write(
  -	                            "\tparam->"
  -	                                + attribs[i].getParamNameAsMember()
  -	                                + " = *(pIWSDZ->"
  -	                                + CUtils.getParameterGetValueMethodName(
  -	                                    attribs[i].getTypeName(),
  -	                                    attribs[i].isAttribute())
  -	                                + "(\""
  -	                                + attribs[i].getParamName()
  -	                                + "\",0));\n");
  +				writer.write( "\t" + attribs[i].getTypeName() + "* p_" + attribs[i].getParamNameAsMember()
  +                                        + " = (pIWSDZ->"
  +                                        + CUtils.getParameterGetValueMethodName(
  +                                            attribs[i].getTypeName(),
  +                                            attribs[i].isAttribute())
  +                                        + "(\""
  +                                        + attribs[i].getParamName()
  +                                        + "\",0));\n");
  +                                writer.write(
  +                                    "\tparam->"
  +                                        + attribs[i].getParamNameAsMember() + " = *p_"
+ attribs[i].getParamNameAsMember() + ";\n");
  +
  +                                writer.write("\tdelete p_" + attribs[i].getParamNameAsMember()
+ ";\n");
                       	}
                       	else if(attribs[i].getTypeName().equals("xsd__string"))
   			{
  @@ -477,16 +480,20 @@
                       	else
                       	{
   	                        //TODO handle optional attributes
  -	                        writer.write(
  -	                            "\tparam->"
  -	                                + attribs[i].getParamNameAsMember()
  -	                                + " = *(pIWSDZ->"
  -	                                + CUtils.getParameterGetValueMethodName(
  -	                                    attribs[i].getTypeName(),
  -	                                    attribs[i].isAttribute())
  -	                                + "(\""
  -	                                + attribs[i].getParamName()
  -	                                + "\",0));\n");
  +				writer.write( "\t" + attribs[i].getTypeName() + "* p_" + attribs[i].getParamNameAsMember()
  +                                        + " = (pIWSDZ->"
  +                                        + CUtils.getParameterGetValueMethodName(
  +                                            attribs[i].getTypeName(),
  +                                            attribs[i].isAttribute())
  +                                        + "(\""
  +                                        + attribs[i].getParamName()
  +                                        + "\",0));\n");
  +                                writer.write(
  +                                    "\tparam->"
  +                                        + attribs[i].getParamNameAsMember() + " = *p_"
+ attribs[i].getParamNameAsMember() + ";\n");
  +
  +                                writer.write("\tdelete p_" + attribs[i].getParamNameAsMember()
+ ";\n");
  +
                       	}
                       }
                       else
  
  
  
  1.75      +6 -2      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
  
  Index: ClientStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- ClientStubWriter.java	4 Mar 2005 14:54:56 -0000	1.74
  +++ ClientStubWriter.java	8 Mar 2005 08:41:57 -0000	1.75
  @@ -709,8 +709,12 @@
                           //            writer.write("\t\t}\n\t\tm_pCall->unInitialize();\n");
   			if (outparamTypeName.equals("xsd__string") ) 
                           	writer.write("\t\treturn Ret;\n");
  -			else 
  -	                        writer.write("\t\treturn *Ret;\n");
  +			else
  +                        {
  +				writer.write("\t\t" + outparamTypeName + " r = *Ret;\n"); // make deep copy
  +				writer.write("\t\tdelete Ret;\n");  // delete pointer
  +                                writer.write("\t\treturn r;\n");
  +                        }
                       }
                       else
                       {
  
  
  

Mime
View raw message