Fix NPE onDestroy
Change-Id: I6aa1951fd3d69e07d1fbc7712fe2526dd9a5ef57
This commit is contained in:
parent
dac53d9c7d
commit
88327fb73b
1 changed files with 7 additions and 3 deletions
|
@ -355,10 +355,14 @@ public class LatinIME extends InputMethodService
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
|
if (mUserDictionary != null) {
|
||||||
mUserDictionary.close();
|
mUserDictionary.close();
|
||||||
|
}
|
||||||
|
if (mContactsDictionary != null) {
|
||||||
mContactsDictionary.close();
|
mContactsDictionary.close();
|
||||||
|
}
|
||||||
unregisterReceiver(mReceiver);
|
unregisterReceiver(mReceiver);
|
||||||
if (VOICE_INSTALLED) {
|
if (VOICE_INSTALLED && mVoiceInput != null) {
|
||||||
mVoiceInput.destroy();
|
mVoiceInput.destroy();
|
||||||
}
|
}
|
||||||
LatinImeLogger.commit();
|
LatinImeLogger.commit();
|
||||||
|
|
Loading…
Reference in a new issue