Terminate method

Called when the filter is deactivated.

Syntax

HRESULT retVal = object.Terminate(hrStatus);

Parameters

  • hrStatus
    Type: HRESULT

    Specifies the exit code of the filter.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Examples

The following examples demonstrate the use of IImageDecodeFilter::Terminate to release and free resources associated with the filter:

STDMETHODIMP
CImageDecodeFilter::Terminate(HRESULT hrStatus)
{
    if(m_pEventSink)
    {
        m_pEventSink->OnDecodeComplete(hrStatus);
        m_pEventSink.Release();
    }

    if (m_pFormats)
        CoTaskMemFree(m_pFormats);

    return S_OK;
}

See also

IImageDecodeFilter::Initialize