void deallocChannel(int channelPtr) {
        if (HydnaDebug.HYDNADEBUG) {
            DebugHelper.debugPrint("Connection",
                                    channelPtr,
                                    "Deallocating a channel");
        }

        if (isDestroying()) {
            // Ignore if we are destroying.
            return;
        }

        m_openChannels.remove(channelPtr);

        if (HydnaDebug.HYDNADEBUG) {
            DebugHelper.debugPrint("Connection",
                                    channelPtr,
                                    "Size of openSteams is now "
                                         + m_openChannels.size());
        }

        --m_channelRefCount;

        checkRefCount();
    }