~singpolyma/cheogram-android

9c9b71840fbb87baaf639f4f4ae2b66d4867ed52 — Stephen Paul Weber 4 days ago a6740aa fix-memleak
Fix memory leak
M src/main/java/eu/siacs/conversations/entities/Conversation.java => src/main/java/eu/siacs/conversations/entities/Conversation.java +6 -3
@@ 1224,12 1224,15 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
    public class ConversationPagerAdapter extends PagerAdapter {
        protected ViewPager mPager = null;
        protected TabLayout mTabs = null;
        ArrayList<CommandSession> sessions = new ArrayList<>();
        ArrayList<CommandSession> sessions = null;

        public void setupViewPager(ViewPager pager, TabLayout tabs) {
            mPager = pager;
            mTabs = tabs;
            show();

            if (mPager == null) return;
            if (sessions != null) show();

            pager.setAdapter(this);
            tabs.setupWithViewPager(mPager);
            pager.setCurrentItem(getCurrentTab());


@@ 1253,7 1256,7 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
        }

        public void hide() {
            if (!sessions.isEmpty()) return; // Do not hide during active session
            if (sessions != null && !sessions.isEmpty()) return; // Do not hide during active session
            if (mPager != null) mPager.setCurrentItem(0);
            if (mTabs != null) mTabs.setVisibility(View.GONE);
            sessions = null;

M src/main/java/eu/siacs/conversations/ui/ConversationFragment.java => src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +1 -0
@@ 1255,6 1255,7 @@ public class ConversationFragment extends XmppFragment
        Log.d(Config.LOGTAG, "ConversationFragment.onDestroyView()");
        messageListAdapter.setOnContactPictureClicked(null);
        messageListAdapter.setOnContactPictureLongClicked(null);
        conversation.setupViewPager(null, null);
    }

    private void quoteText(String text) {