axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r388919 - in /webservices/axis2/trunk/c: include/axis2_thread.h modules/core/transport/http/server/apache2/apache2_worker.c modules/platforms/unix/thread_unix.c modules/platforms/windows/thread_windows.c modules/util/thread_pool.c
Date Sun, 26 Mar 2006 16:00:40 GMT
Author: sahan
Date: Sun Mar 26 08:00:38 2006
New Revision: 388919

URL: http://svn.apache.org/viewcvs?rev=388919&view=rev
Log:
more memory leak cleaning

Modified:
    webservices/axis2/trunk/c/include/axis2_thread.h
    webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c
    webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c
    webservices/axis2/trunk/c/modules/platforms/windows/thread_windows.c
    webservices/axis2/trunk/c/modules/util/thread_pool.c

Modified: webservices/axis2/trunk/c/include/axis2_thread.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_thread.h?rev=388919&r1=388918&r2=388919&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_thread.h (original)
+++ webservices/axis2/trunk/c/include/axis2_thread.h Sun Mar 26 08:00:38 2006
@@ -109,7 +109,7 @@
  * @return The status of the operation
  */
 AXIS2_DECLARE(axis2_status_t) 
-axis2_thread_exit(axis2_thread_t *thd);
+axis2_thread_exit(axis2_thread_t *thd, axis2_allocator_t *allocator);
 
 /**
  * Block until the desired thread stops executing.

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c?rev=388919&r1=388918&r2=388919&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c
(original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c
Sun Mar 26 08:00:38 2006
@@ -149,6 +149,8 @@
     axis2_property_t *property = NULL;
     axis2_url_t *url = NULL;
     axis2_http_out_transport_info_t *apache2_out_transport_info = NULL;
+    axis2_qname_t *transport_qname = NULL;
+    axis2_char_t *ctx_uuid = NULL;
 	
     AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, request, AXIS2_CRTICAL_FAILURE);
@@ -187,15 +189,17 @@
 						http_version);
 	
 	encoding_header_value = (axis2_char_t*)request->content_encoding;
-		
+
+    transport_qname = axis2_qname_create(env, AXIS2_TRANSPORT_HTTP, NULL,
+                        NULL);		
 	out_desc = AXIS2_CONF_GET_TRANSPORT_OUT(AXIS2_CONF_CTX_GET_CONF
 						(apache2_worker_impl->conf_ctx, env), env, 
-						axis2_qname_create(env, AXIS2_TRANSPORT_HTTP, NULL, 
-						NULL));
+                        transport_qname);
 	in_desc = AXIS2_CONF_GET_TRANSPORT_IN(AXIS2_CONF_CTX_GET_CONF
 						(apache2_worker_impl->conf_ctx, env), env, 
-						axis2_qname_create(env, AXIS2_TRANSPORT_HTTP, NULL,
-						NULL));
+						transport_qname);
+    AXIS2_QNAME_FREE(transport_qname, env);
+
 	msg_ctx = axis2_msg_ctx_create(env, conf_ctx, in_desc, out_desc);
 	AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env, AXIS2_TRUE);
 	
@@ -209,7 +213,9 @@
 	/*AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_HEADERS, 
 						axis2_apache2_worker_get_headers(apache2_worker, env, 
                         simple_request), AXIS2_FALSE);*/
-	AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, axis2_uuid_gen(env));
+    ctx_uuid = axis2_uuid_gen(env);
+	AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, ctx_uuid);
+    AXIS2_FREE((*env)->allocator, ctx_uuid);
     
     property = axis2_property_create(env);
     AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
@@ -307,7 +313,6 @@
         AXIS2_FREE((*env)->allocator, body_string);
         body_string = NULL;
     }
-    /*AXIS2_MSG_CTX_FREE(msg_ctx, env);*/
     if(NULL != url)
     {
         AXIS2_URL_FREE(url, env);
@@ -323,6 +328,7 @@
         AXIS2_STREAM_FREE(request_body, env);
         request_body = NULL;
     }
+    AXIS2_MSG_CTX_FREE(msg_ctx, env);
     msg_ctx = NULL;
 	return send_status;
 }

Modified: webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c?rev=388919&r1=388918&r2=388919&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c (original)
+++ webservices/axis2/trunk/c/modules/platforms/unix/thread_unix.c Sun Mar 26 08:00:38 2006
@@ -136,8 +136,18 @@
 }
 
 AXIS2_DECLARE(axis2_status_t)
-axis2_thread_exit(axis2_thread_t *thd)
+axis2_thread_exit(axis2_thread_t *thd, axis2_allocator_t *allocator)
 {
+    if(NULL != thd)
+    {
+        if(NULL != thd->td)
+        {
+            AXIS2_FREE(allocator, thd->td);
+            thd->td = NULL;
+        }
+        AXIS2_FREE(allocator, thd);
+        thd = NULL;
+    }
     pthread_exit(NULL);
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/platforms/windows/thread_windows.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/windows/thread_windows.c?rev=388919&r1=388918&r2=388919&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/platforms/windows/thread_windows.c (original)
+++ webservices/axis2/trunk/c/modules/platforms/windows/thread_windows.c Sun Mar 26 08:00:38
2006
@@ -106,7 +106,8 @@
         return NULL;
     }
 	
-    if (attr && attr->detach) {
+    if (attr && attr->detach)
+    {
         CloseHandle(handle);
     }
     else
@@ -116,8 +117,12 @@
 }
 
 AXIS2_DECLARE(axis2_status_t)
-axis2_thread_exit(axis2_thread_t *thd)
+axis2_thread_exit(axis2_thread_t *thd, axis2_allocator_t *allocator)
 {
+    if(NULL != thd)
+    {
+        AXIS2_FREE(allocator, thd);
+    }
     ExitThread(0);
 
     return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/modules/util/thread_pool.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/thread_pool.c?rev=388919&r1=388918&r2=388919&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/thread_pool.c (original)
+++ webservices/axis2/trunk/c/modules/util/thread_pool.c Sun Mar 26 08:00:38 2006
@@ -134,11 +134,12 @@
 axis2_thread_pool_exit_thread (axis2_thread_pool_t *pool, 
 						axis2_thread_t *thd)
 {
+    axis2_thread_pool_impl_t *pool_impl = AXIS2_INTF_TO_IMPL(pool);
 	if(NULL == pool || NULL == thd)
 	{
 		return AXIS2_FAILURE;
 	}
-	return axis2_thread_exit(thd);
+	return axis2_thread_exit(thd, pool_impl->allocator);
 }
 
 



Mime
View raw message