From b21edc44026bac1a41cbf01aa4476c5cdf2a1812 Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Thu, 17 Apr 2014 09:28:52 +0900 Subject: [PATCH] Shuwdown executors after executing all tasks. Bug: 14113276 Change-Id: Ie42ef30ffe5767ca434db4669efad2027b474e74 --- .../android/inputmethod/latin/utils/ExecutorUtils.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/utils/ExecutorUtils.java b/java/src/com/android/inputmethod/latin/utils/ExecutorUtils.java index ee9718ad3..ed502ed3d 100644 --- a/java/src/com/android/inputmethod/latin/utils/ExecutorUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/ExecutorUtils.java @@ -47,8 +47,13 @@ public class ExecutorUtils { public static void shutdownAllExecutors() { synchronized(sExecutorMap) { for (final PrioritizedSerialExecutor executor : sExecutorMap.values()) { - executor.shutdown(); - sExecutorMap.remove(executor); + executor.execute(new Runnable() { + @Override + public void run() { + executor.shutdown(); + sExecutorMap.remove(executor); + } + }); } } }