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 sa...@apache.org on 2006/11/23 07:38:23 UTC

svn commit: r478487 - in /webservices/axis2/trunk/c: modules/core/transport/http/receiver/http_svr_thread.c util/src/env.c util/src/thread_pool.c

Author: samisa
Date: Wed Nov 22 22:38:23 2006
New Revision: 478487

URL: http://svn.apache.org/viewvc?view=rev&rev=478487
Log:
More memory leak fixes

Modified:
    webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_svr_thread.c
    webservices/axis2/trunk/c/util/src/env.c
    webservices/axis2/trunk/c/util/src/thread_pool.c

Modified: webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_svr_thread.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_svr_thread.c?view=diff&rev=478487&r1=478486&r2=478487
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_svr_thread.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_svr_thread.c Wed Nov 22 22:38:23 2006
@@ -219,11 +219,9 @@
         arg_list->env = (axis2_env_t *)env;
         arg_list->socket = socket;
         arg_list->worker = svr_thread_impl->worker;
-        arg_list->thread = NULL;
 #ifdef AXIS2_SVR_MULTI_THREADED
         worker_thread = AXIS2_THREAD_POOL_GET_THREAD(env->thread_pool,
                 worker_func, (void *)arg_list);
-        arg_list->thread = worker_thread;
         if (NULL == worker_thread)
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Thread creation failed"
@@ -369,11 +367,7 @@
                 secs);
 #endif
     }
-    /*axis2_env_free_masked(thread_env, 0x2);*/
-    /*axiom_xml_reader_cleanup();*/
-#ifdef AXIS2_SVR_MULTI_THREADED
-    AXIS2_THREAD_POOL_EXIT_THREAD(thread_env->thread_pool, arg_list->thread);
-#endif
+
     AXIS2_FREE(thread_env->allocator, arg_list);
 
     if (thread_env)
@@ -381,5 +375,9 @@
         axis2_free_thread_env(thread_env);
         thread_env = NULL;
     }
+#ifdef AXIS2_SVR_MULTI_THREADED
+    AXIS2_THREAD_POOL_EXIT_THREAD(env->thread_pool, thd);
+#endif
+
     return NULL;
 }

Modified: webservices/axis2/trunk/c/util/src/env.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/env.c?view=diff&rev=478487&r1=478486&r2=478487
==============================================================================
--- webservices/axis2/trunk/c/util/src/env.c (original)
+++ webservices/axis2/trunk/c/util/src/env.c Wed Nov 22 22:38:23 2006
@@ -74,7 +74,7 @@
         AXIS2_THREAD_POOL_FREE(env->thread_pool);
         env->thread_pool = NULL;
     }
-    if (env)
+    if (env && env->allocator)
     {
         AXIS2_FREE(env->allocator, env);
         env = NULL;

Modified: webservices/axis2/trunk/c/util/src/thread_pool.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/thread_pool.c?view=diff&rev=478487&r1=478486&r2=478487
==============================================================================
--- webservices/axis2/trunk/c/util/src/thread_pool.c (original)
+++ webservices/axis2/trunk/c/util/src/thread_pool.c Wed Nov 22 22:38:23 2006
@@ -167,8 +167,16 @@
 AXIS2_EXTERN void AXIS2_CALL
 axis2_free_thread_env(struct axis2_env *thread_env)
 {
-    thread_env->allocator = NULL;
+    if (!thread_env)
+        return;
+    /* log, thread_pool and allocator are shared, so do not free them */
     thread_env->log = NULL;
     thread_env->thread_pool = NULL;
-    axis2_env_free(thread_env);
+    if (thread_env->error)
+    {
+        AXIS2_ERROR_FREE(thread_env->error);
+        thread_env->error = NULL;
+    }
+    AXIS2_FREE(thread_env->allocator, thread_env);
 }
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org