Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d3e1210 authored by Satoshi Kataoka's avatar Satoshi Kataoka
Browse files

Fix memory leak in EmojiPaletteView

Bug: 10902556
Change-Id: I3a8c1e08d6f953b462d914acd1f411c36f9d80f2
parent d900b90d
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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);
            }
        }
    }