From 65db0262659562d4893e34b9e905e57c11fa3557 Mon Sep 17 00:00:00 2001 From: Keisuke Kuroynagi Date: Thu, 4 Jul 2013 23:12:49 +0900 Subject: [PATCH] Fix: release lock in UserHistoryDictionary. Change-Id: I050c252910c6b5b0a79cd2d52c525679f2d6091d --- .../android/inputmethod/latin/UserHistoryDictionary.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java index ca2d8840b..8c668b810 100644 --- a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java +++ b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java @@ -320,7 +320,11 @@ public final class UserHistoryDictionary extends ExpandableDictionary { mUserHistoryDictionary.mBigramListLock.unlock(); } } else if (mUserHistoryDictionary.mBigramListLock.tryLock()) { - doWriteTaskLocked(); + try { + doWriteTaskLocked(); + } finally { + mUserHistoryDictionary.mBigramListLock.unlock(); + } } return null; }