tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r979896 - /tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
Date Tue, 27 Jul 2010 22:36:06 GMT
Author: markt
Date: Tue Jul 27 22:36:06 2010
New Revision: 979896

URL: http://svn.apache.org/viewvc?rev=979896&view=rev
Log:
More unit test fixes - better handling when APR/native connector is not started

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=979896&r1=979895&r2=979896&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Tue Jul 27 22:36:06 2010
@@ -702,27 +702,27 @@ public class AprEndpoint extends Abstrac
         if (running) {
             stop();
         }
-        try {
+        
+        // Destroy pool if it was initialised
+        if (serverSockPool != 0) {
             Pool.destroy(serverSockPool);
-        } catch (UnsatisfiedLinkError e) {
-            // Ignore - APR was not initialised
+            serverSockPool = 0;
         }
-        serverSockPool = 0;
-        // Close server socket
-        try {
+        
+        // Close server socket if it was initialised
+        if (serverSock != 0) {
             Socket.close(serverSock);
-        } catch (UnsatisfiedLinkError e) {
-            // Ignore - APR was not initialised
+            serverSock = 0;
         }
-        serverSock = 0;
+        
         sslContext = 0;
-        // Close all APR memory pools and resources
-        try {
+        
+        // Close all APR memory pools and resources if initialised
+        if (rootPool != 0) {
             Pool.destroy(rootPool);
-        } catch (UnsatisfiedLinkError e) {
-            // Ignore - APR was not initialised
+            rootPool = 0;
         }
-        rootPool = 0;
+        
         initialized = false;
     }
 



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


Mime
View raw message