tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r992208 - in /tomcat/native/trunk/native/src: network.c pool.c
Date Fri, 03 Sep 2010 05:22:08 GMT
Author: mturk
Date: Fri Sep  3 05:22:07 2010
New Revision: 992208

URL: http://svn.apache.org/viewvc?rev=992208&view=rev
Log:
Don't destroy pools explicitly if we are inside apr_terminate call

Modified:
    tomcat/native/trunk/native/src/network.c
    tomcat/native/trunk/native/src/pool.c

Modified: tomcat/native/trunk/native/src/network.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/network.c?rev=992208&r1=992207&r2=992208&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/network.c (original)
+++ tomcat/native/trunk/native/src/network.c Fri Sep  3 05:22:07 2010
@@ -222,6 +222,11 @@ TCN_IMPLEMENT_CALL(void, Socket, destroy
     UNREFERENCED_STDARGS;
     TCN_ASSERT(sock != 0);
 
+    if (!tcn_global_pool) {
+        /* Socket will be destroyed by the cleanup
+         */
+        return;
+    }
     as = s->sock;
     s->sock = NULL;
     apr_pool_cleanup_kill(s->pool, s, sp_socket_cleanup);

Modified: tomcat/native/trunk/native/src/pool.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/pool.c?rev=992208&r1=992207&r2=992208&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/pool.c (original)
+++ tomcat/native/trunk/native/src/pool.c Fri Sep  3 05:22:07 2010
@@ -69,7 +69,8 @@ TCN_IMPLEMENT_CALL(void, Pool, destroy)(
     apr_pool_t *p = J2P(pool, apr_pool_t *);
     UNREFERENCED_STDARGS;
     TCN_ASSERT(pool != 0);
-    apr_pool_destroy(p);
+    if (tcn_global_pool)
+        apr_pool_destroy(p);
 }
 
 TCN_IMPLEMENT_CALL(jlong, Pool, parentGet)(TCN_STDARGS, jlong pool)
@@ -179,7 +180,7 @@ static apr_status_t generic_pool_data_cl
     if (data) {
         JNIEnv *env;
         tcn_get_java_env(&env);
-        
+
         if (!TCN_IS_NULL(env, cb->obj)) {
             TCN_UNLOAD_CLASS(env, cb->obj);
         }
@@ -204,7 +205,7 @@ TCN_IMPLEMENT_CALL(jint, Pool, dataSet)(
             apr_pool_cleanup_run(p, old, generic_pool_data_cleanup);
     }
     if (data) {
-        JNIEnv *e;        
+        JNIEnv *e;
         tcn_callback_t *cb = (tcn_callback_t *)malloc(sizeof(tcn_callback_t));
         tcn_get_java_env(&e);
         cb->obj = (*e)->NewGlobalRef(e, data);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message