Microsoft DirectX 9.0 SDK Update (October 2004) |
To exit an audio application cleanly, you must perform five main steps:
The following code from the WinMain function in the tutorial sample is called when the dialog box is closed.
g_pPerformance->Stop(
NULL, // Stop all segments.
NULL, // Stop all segment states.
0, // Do it immediately.
0 // Flags.
);
g_pSegment->Unload(g_pPerformance);
g_pPerformance->CloseDown();
g_pLoader->Release();
g_pPerformance->Release();
g_pSegment->Release();
CoUninitialize();
return 0; // Return value for WinMain.
} // End of WinMain.