aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2013-10-08 18:54:24 +0900
committerSatoshi Kataoka <satok@google.com>2013-10-08 19:05:00 +0900
commit2d3e121014a97b7de90f287f1ef82fa98f37007c (patch)
tree99873ab6e43987c9a68a1b910ccdce0e42b5c7a2 /java
parentd900b90db7d411c8cfc8ff9e41518bf98f50daff (diff)
downloadlatinime-2d3e121014a97b7de90f287f1ef82fa98f37007c.tar.gz
latinime-2d3e121014a97b7de90f287f1ef82fa98f37007c.tar.xz
latinime-2d3e121014a97b7de90f287f1ef82fa98f37007c.zip
Fix memory leak in EmojiPaletteView
Bug: 10902556 Change-Id: I3a8c1e08d6f953b462d914acd1f411c36f9d80f2
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
index ef9448c2f..5c518b8f1 100644
--- a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
+++ b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
@@ -694,13 +694,16 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
@Override
public void destroyItem(final ViewGroup container, final int position,
final Object object) {
- ScrollKeyboardView keyboardView = mActiveKeyboardViews.get(position);
+ final ScrollKeyboardView keyboardView = mActiveKeyboardViews.get(position);
if (keyboardView != null) {
keyboardView.deallocateMemory();
mActiveKeyboardViews.remove(position);
}
- container.removeView(keyboardView);
- keyboardView = null;
+ if (object instanceof View) {
+ container.removeView((View)object);
+ } else {
+ Log.w(TAG, "Warning!!! Emoji palette may be leaking. " + object);
+ }
}
}