am 2715465b: am 67aa1a93: am 2d3e1210: Fix memory leak in EmojiPaletteView
* commit '2715465b9487c00fc38676494d1f9dd3ea1a15f2':
Fix memory leak in EmojiPaletteView
diff --git a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
index ef9448c..5c518b8 100644
--- a/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
+++ b/java/src/com/android/inputmethod/keyboard/EmojiPalettesView.java
@@ -694,13 +694,16 @@
@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);
+ }
}
}