Fixed a memory leak that happens when switching input languages.

main
Amith Yamasani 2010-01-15 13:43:50 -08:00
parent 6e4ffc14d4
commit 388ce92ab8
1 changed files with 3 additions and 0 deletions

View File

@ -22,6 +22,8 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import com.android.inputmethod.latin.UserDictionary;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.backup.BackupManager; import android.backup.BackupManager;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
@ -226,6 +228,7 @@ public class LatinIME extends InputMethodService
mSuggest.close(); mSuggest.close();
} }
mSuggest = new Suggest(this, R.raw.main); mSuggest = new Suggest(this, R.raw.main);
if (mUserDictionary != null) mUserDictionary.close();
mUserDictionary = new UserDictionary(this); mUserDictionary = new UserDictionary(this);
if (mContactsDictionary == null) { if (mContactsDictionary == null) {
mContactsDictionary = new ContactsDictionary(this); mContactsDictionary = new ContactsDictionary(this);