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; }