PvmfMediaInputNodeOutPort::~PvmfMediaInputNodeOutPort()
{
    PvmfPortBaseImpl::ClearMsgQueues();


    if (iMediaDataAlloc != NULL)
    {
        OSCL_DELETE(iMediaDataAlloc);
    }

    if (iMediaDataAllocMemPool)
    {
        iMediaDataAllocMemPool->removeRef();
    }

    if (iMediaDataMemPool)
    {
        iMediaDataMemPool->removeRef();
    }
    iDataPathLogger = NULL;

    // we need to clear the activity handler, since otherwise the PvmfPortBaseImpl destructor
    // ends up calling back onto our HandlePortActivity method, which no longer exists because
    // this objects's destructor has already been called.
    SetActivityHandler(NULL);
}
PVMp4FFComposerPort::~PVMp4FFComposerPort()
{
    if (memfrag_sps)
    {
        for (uint32 i = 0; i < iNode->memvector_sps.size(); i++)
        {
            OSCL_FREE(iNode->memvector_sps[i]->ptr);
        }

        while (!iNode->memvector_sps.empty())
        {
            if (iNode->memvector_sps.front())
            {
                OSCL_FREE(iNode->memvector_sps.front());
            }
            iNode->memvector_sps.erase(&iNode->memvector_sps.front());
        }
    }

    if (memfrag_pps)
    {
        for (uint32 i = 0; i < iNode->memvector_pps.size(); i++)
        {
            OSCL_FREE(iNode->memvector_pps[i]->ptr);
        }

        while (!iNode->memvector_pps.empty())
        {
            if (iNode->memvector_pps.front())
            {
                OSCL_FREE(iNode->memvector_pps.front());
            }
            iNode->memvector_pps.erase(&iNode->memvector_pps.front());
        }
    }

    if (iNode->textdecodervector.size() > 0)
    {

        while (!iNode->textdecodervector.empty())
        {
            if (iNode->textdecodervector.front())
            {
                OSCL_DELETE(iNode->textdecodervector.front());
            }

            iNode->textdecodervector.erase(&iNode->textdecodervector.front());
        }
    }
    Disconnect();
    ClearMsgQueues();

    // we need to clear the activity handler, since otherwise the PvmfPortBaseImpl destructor
    // ends up calling back onto our HandlePortActivity method, which no longer exists because
    // this objects's destructor has already been called.
    SetActivityHandler(NULL);
}
OSCL_EXPORT_REF PVMFBufferDataSource::~PVMFBufferDataSource()
{
    Stop();
    if (iMediaDataAlloc)
    {
        OSCL_DELETE(iMediaDataAlloc);
        iMediaDataAlloc = NULL;
    }
    if (iFsi)
    {
        OSCL_DEFAULT_FREE(iFsi);
        iFsi = NULL;
    }

    // we need to clear the activity handler, since otherwise the PvmfPortBaseImpl destructor
    // ends up calling back onto our HandlePortActivity method, which no longer exists because
    // this objects's destructor has already been called.
    SetActivityHandler(NULL);
}
OSCL_EXPORT_REF PVMFBufferDataSink::~PVMFBufferDataSink()
{
    SetActivityHandler(NULL);
}