From 94890ee9a08901c494c5db2afe1dd8e8a688b2ad Mon Sep 17 00:00:00 2001 From: mguessan Date: Thu, 5 May 2011 20:16:19 +0000 Subject: [PATCH] LDAP: cancel search threads on connection close git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1671 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/ldap/LdapConnection.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/java/davmail/ldap/LdapConnection.java b/src/java/davmail/ldap/LdapConnection.java index 664ddcb7..13d2d97e 100644 --- a/src/java/davmail/ldap/LdapConnection.java +++ b/src/java/davmail/ldap/LdapConnection.java @@ -583,6 +583,13 @@ public class LdapConnection extends AbstractConnection { DavGatewayTray.debug(new BundleMessage("LOG_EXCEPTION_SENDING_ERROR_TO_CLIENT"), e2); } throw e; + } finally { + // cancel all search threads + synchronized (searchThreadMap) { + for (SearchRunnable searchRunnable:searchThreadMap.values()) { + searchRunnable.abandon(); + } + } } }