if (mSession.isSelected()) { mSession.deselectFolder(); }
    private void gotoClosedStateInternal(boolean sendBanner) throws IOException {        synchronized (mCloseLock) {            // Close only once            if (mState == ConnectionState.CLOSED) {                throw new IllegalStateException("connection already closed");            }            try {                mConnection.setMatcher(new OzAllMatcher());                if (mSession != null) {                    // remove this when 9748 is fixed - this is for some aggressive GC                    if (mSession.isSelected()) {                        mSession.deselectFolder();                    }                    mSession.setHandler(null);                    SessionCache.clearSession(mSession.getSessionId(), mSession.getAccountId());                    mSession = null;                }                if (sendBanner) {                    if (!mGoodbyeSent) {                        sendUntagged(ImapServer.getGoodbye(), true);                    }                    mGoodbyeSent = true;                }            } finally {                mState = ConnectionState.CLOSED;            }        }    }