From d6e5357c057898b15771ac00197b0755c89627e1 Mon Sep 17 00:00:00 2001 From: Tonyo Francis Date: Wed, 22 May 2019 10:03:09 -0400 Subject: [PATCH] Thread fixes --- .../java/com/tonyodev/dispatch/thread/DefaultThreadHandler.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dispatch/src/main/java/com/tonyodev/dispatch/thread/DefaultThreadHandler.kt b/dispatch/src/main/java/com/tonyodev/dispatch/thread/DefaultThreadHandler.kt index 78b5ee0..20784bd 100644 --- a/dispatch/src/main/java/com/tonyodev/dispatch/thread/DefaultThreadHandler.kt +++ b/dispatch/src/main/java/com/tonyodev/dispatch/thread/DefaultThreadHandler.kt @@ -55,9 +55,7 @@ class DefaultThreadHandler(override val threadName: String): Thread(), ThreadHan } if (!isCancelled) { synchronized(queue) { - if (queueIndex < queue.size) { - queue.removeAt(queueIndex) - } + queue.remove(queueItem!!) } } queueItem?.recycle()