From: markt Date: Tue, 27 Jul 2010 22:36:06 +0000 (+0000) Subject: More unit test fixes - better handling when APR/native connector is not started X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e101f20657544ba7c1c1c4b1abae2fa0443b85b9;p=tomcat7.0 More unit test fixes - better handling when APR/native connector is not started git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@979896 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index e6a3a3345..bf60c98eb 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -702,27 +702,27 @@ public class AprEndpoint extends AbstractEndpoint { 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; }