You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by da...@apache.org on 2006/02/23 12:20:08 UTC

svn commit: r380096 - in /webservices/axis2/trunk/c: include/axis2_wsdl_op.h modules/core/clientapi/call.c modules/core/description/op.c modules/core/description/svc.c modules/core/phaseresolver/phase_resolver.c modules/wsdl/wsdl_interface.c

Author: damitha
Date: Thu Feb 23 03:19:59 2006
New Revision: 380096

URL: http://svn.apache.org/viewcvs?rev=380096&view=rev
Log:
More fixed on memory leaks

Modified:
    webservices/axis2/trunk/c/include/axis2_wsdl_op.h
    webservices/axis2/trunk/c/modules/core/clientapi/call.c
    webservices/axis2/trunk/c/modules/core/description/op.c
    webservices/axis2/trunk/c/modules/core/description/svc.c
    webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c
    webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c

Modified: webservices/axis2/trunk/c/include/axis2_wsdl_op.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_wsdl_op.h?rev=380096&r1=380095&r2=380096&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_wsdl_op.h (original)
+++ webservices/axis2/trunk/c/include/axis2_wsdl_op.h Thu Feb 23 03:19:59 2006
@@ -268,6 +268,9 @@
 
 #define AXIS2_WSDL_OP_FREE(wsdl_op, env) \
 		((wsdl_op)->ops->free (wsdl_op, env))
+
+#define AXIS2_WSDL_OP_FREE_VOID_ARG(wsdl_op, env) \
+		(((axis2_wsdl_op_t *) wsdl_op)->ops->free_void_arg(wsdl_op, env))
 	
 #define AXIS2_WSDL_OP_GET_MSG_EXCHANGE_PATTERN(wsdl_op, env) \
 		((wsdl_op)->ops->get_msg_exchange_pattern(wsdl_op, env))

Modified: webservices/axis2/trunk/c/modules/core/clientapi/call.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/call.c?rev=380096&r1=380095&r2=380096&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/call.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/call.c Thu Feb 23 03:19:59 2006
@@ -1104,15 +1104,15 @@
     
     call_impl = AXIS2_INTF_TO_IMPL(call);
     
-    /* if the operation is not alrady define we will copy the
-    crated Phases from the templete operation to the this Operation */
+    /* if the operation is not alrady defined we will copy the
+    created Phases from the templete operation to the this Operation */
 
     op_qname = axis2_qname_create(env, op_name, NULL, NULL);
     if (op_qname)
     {
         axis2_svc_t *svc = NULL;
         axis2_array_list_t *remaining_phases = NULL;
-        
+
         op = axis2_op_create_with_qname(env, op_qname);
         AXIS2_OP_SET_MSG_EXCHANGE_PATTERN(op, env, AXIS2_MEP_URI_OUT_IN);
         if(!op)

Modified: webservices/axis2/trunk/c/modules/core/description/op.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/op.c?rev=380096&r1=380095&r2=380096&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/op.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/op.c Thu Feb 23 03:19:59 2006
@@ -631,8 +631,14 @@
 axis2_op_free (axis2_op_t *op, axis2_env_t **env)
 { 
     axis2_op_impl_t *op_impl = NULL;
+    axis2_qname_t *op_qname = NULL;
+    axis2_char_t *op_name = NULL;
+
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     op_impl = AXIS2_INTF_TO_IMPL(op);
+
+    op_qname = AXIS2_OP_GET_QNAME(&(op_impl->op), env);
+    op_name = AXIS2_QNAME_GET_LOCALPART(op_qname, env); 
     
 	if(NULL != op->ops)
     {
@@ -655,8 +661,9 @@
     op_impl->parent = NULL;
     
     op_impl->msg_recv = NULL;
-    
-    if(NULL != op_impl->remaining_phases_inflow)
+
+    if(NULL != op_impl->remaining_phases_inflow && 
+        (0 != AXIS2_STRCMP(op_name, "TemplateOperation")))
     {
         int i = 0;
         int size = 0;
@@ -678,7 +685,8 @@
         op_impl->remaining_phases_inflow = NULL;
     }
     
-    if(NULL != op_impl->phases_outflow)
+    if(NULL != op_impl->phases_outflow &&
+        (0 != AXIS2_STRCMP(op_name, "TemplateOperation")))
     {
         int i = 0;
         int size = 0;

Modified: webservices/axis2/trunk/c/modules/core/description/svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/svc.c?rev=380096&r1=380095&r2=380096&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/svc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/svc.c Thu Feb 23 03:19:59 2006
@@ -541,6 +541,7 @@
     
     if(NULL != svc_impl->wasaction_opeartionmap)
     {
+        /* By this time operations are already freed
         axis2_hash_index_t *hi = NULL;
         void *val = NULL;
         for (hi = axis2_hash_first (svc_impl->wasaction_opeartionmap, env); hi;
@@ -557,6 +558,7 @@
             val = NULL;
                
         }
+        */
 		axis2_hash_free(svc_impl->wasaction_opeartionmap, env);
         svc_impl->wasaction_opeartionmap = NULL;
     }

Modified: webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c?rev=380096&r1=380095&r2=380096&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c (original)
+++ webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c Thu Feb 23 03:19:59 2006
@@ -1173,6 +1173,11 @@
                     axis2_array_list_t *phase_list = NULL; 
 
                     phase_list = AXIS2_OP_GET_REMAINING_PHASES_INFLOW(op_desc, env);
+                    if(resolver_impl->phase_holder)
+                    {
+                        AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                        resolver_impl->phase_holder = NULL;
+                    }
                     resolver_impl->phase_holder = 
                         axis2_phase_holder_create_with_phases(env, phase_list);
                     break;
@@ -1182,6 +1187,11 @@
                     axis2_array_list_t *phase_list = NULL;
 
                     phase_list = AXIS2_OP_GET_PHASES_OUTFLOW(op_desc, env);
+                    if(resolver_impl->phase_holder)
+                    {
+                        AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                        resolver_impl->phase_holder = NULL;
+                    }
                     resolver_impl->phase_holder = 
                         axis2_phase_holder_create_with_phases(env, phase_list);
                     break;
@@ -1191,6 +1201,11 @@
                     axis2_array_list_t *phase_list = NULL;
 
                     phase_list = AXIS2_OP_GET_PHASES_IN_FAULT_FLOW(op_desc, env);
+                    if(resolver_impl->phase_holder)
+                    {
+                        AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                        resolver_impl->phase_holder = NULL;
+                    }
                     resolver_impl->phase_holder = 
                         axis2_phase_holder_create_with_phases(env, phase_list);
                     break;
@@ -1200,6 +1215,11 @@
                     axis2_array_list_t *phase_list = NULL; 
 
                     phase_list = AXIS2_OP_GET_PHASES_OUT_FAULT_FLOW(op_desc, env);
+                    if(resolver_impl->phase_holder)
+                    {
+                        AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
+                        resolver_impl->phase_holder = NULL;
+                    }
                     resolver_impl->phase_holder = 
                         axis2_phase_holder_create_with_phases(env, phase_list);
                     break;

Modified: webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c?rev=380096&r1=380095&r2=380096&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/wsdl_interface.c Thu Feb 23 03:19:59 2006
@@ -281,16 +281,16 @@
     
     if(NULL != wsdl_interface_impl->ops)
     {
-        /*axis2_hash_index_t *hi = NULL;
+        axis2_hash_index_t *hi = NULL;
         void *val = NULL;
         for (hi = axis2_hash_first (wsdl_interface_impl->ops, env); hi;
                  hi = axis2_hash_next ( env, hi))
         {
             axis2_hash_this (hi, NULL, NULL, &val);
-            AXIS2_WSDL_OP_FREE(val, env);
+            AXIS2_WSDL_OP_FREE_VOID_ARG(val, env);
             val = NULL;
                
-        }*/
+        }
         axis2_hash_free(wsdl_interface_impl->ops, env);
         wsdl_interface_impl->ops = NULL;
     }