diff --git a/source/org/jivesoftware/smackx/filetransfer/FaultTolerantNegotiator.java b/source/org/jivesoftware/smackx/filetransfer/FaultTolerantNegotiator.java index 3d9c3160f..ef1860678 100644 --- a/source/org/jivesoftware/smackx/filetransfer/FaultTolerantNegotiator.java +++ b/source/org/jivesoftware/smackx/filetransfer/FaultTolerantNegotiator.java @@ -79,8 +79,9 @@ public class FaultTolerantNegotiator extends StreamNegotiator { connection.sendPacket(super.createInitiationAccept(initiation, getNamespaces())); + ExecutorService threadPoolExecutor = Executors.newFixedThreadPool(2); CompletionService service - = new ExecutorCompletionService(Executors.newFixedThreadPool(2)); + = new ExecutorCompletionService(threadPoolExecutor); List> futures = new ArrayList>(); 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) {