Share via


Windows Media Player 11 SDK Implementing IMediaObject::FreeStreamingResourcesĀ 

Windows Media Player SDK banner art

Previous Next

Implementing IMediaObject::FreeStreamingResources

It is important that your code releases any allocated memory before the plug-in object is destroyed. Windows Media Player calls FreeStreamingResources to allow you to do this. For safety, the sample created by the plug-in wizard includes a call to FreeStreamingResources in the FinalRelease method to ensure that the memory is freed. You must add the following code to FreeStreamingResources for the Echo sample:

// Test whether a buffer exists.
if (m_pbDelayBuffer)
{
    delete m_pbDelayBuffer;
    m_pbDelayBuffer = NULL;
    m_pbDelayPointer = NULL;
    m_cbDelayBuffer = 0;
}

See Also

Previous Next