From 388ce92ab8a635c5ad44620dad59baf05dfea510 Mon Sep 17 00:00:00 2001
From: Amith Yamasani <yamasani@google.com>
Date: Fri, 15 Jan 2010 13:43:50 -0800
Subject: [PATCH] Fixed a memory leak that happens when switching input
 languages.

---
 src/com/android/inputmethod/latin/LatinIME.java | 3 +++
 1 file changed, 3 insertions(+)

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