1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-23 13:07:59 +01:00

SMACK-353 Fix thread leak issue.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_2_0@12918 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2011-12-19 15:43:52 +00:00
parent e16cb2b4cc
commit 01d444ac78

View file

@ -79,8 +79,9 @@ public class FaultTolerantNegotiator extends StreamNegotiator {
connection.sendPacket(super.createInitiationAccept(initiation, getNamespaces()));
ExecutorService threadPoolExecutor = Executors.newFixedThreadPool(2);
CompletionService<InputStream> service
= new ExecutorCompletionService<InputStream>(Executors.newFixedThreadPool(2));
= new ExecutorCompletionService<InputStream>(threadPoolExecutor);
List<Future<InputStream>> futures = new ArrayList<Future<InputStream>>();
InputStream stream = null;
XMPPException exception = null;
@ -119,6 +120,7 @@ public class FaultTolerantNegotiator extends StreamNegotiator {
future.cancel(true);
}
collector.cancel();
threadPoolExecutor.shutdownNow();
}
if (stream == null) {
if (exception != null) {