From 23a0c7f677079dd5f6aa4c51319140f045eee26f Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 30 Oct 2015 08:55:39 -0500 Subject: [PATCH] xaudio2/tests: Fix memory leaks. Spotted by Nikolay Sivov. Signed-off-by: Andrew Eikum Signed-off-by: Alexandre Julliard --- dlls/xaudio2_7/tests/xaudio2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/xaudio2_7/tests/xaudio2.c b/dlls/xaudio2_7/tests/xaudio2.c index 3f03cc647c8..c7ae9828fd8 100644 --- a/dlls/xaudio2_7/tests/xaudio2.c +++ b/dlls/xaudio2_7/tests/xaudio2.c @@ -766,6 +766,13 @@ static void test_looping(IXAudio2 *xa) ok(played - running_total == 22050 + 44100 * 2, "Got wrong samples played: %u\n", played - running_total); ok(nloopends == (played - running_total) / 88200 + 1, "Got wrong OnLoopEnd calls: %u\n", nloopends); running_total = played; + + if(xaudio27) + IXAudio27SourceVoice_DestroyVoice((IXAudio27SourceVoice*)src); + else + IXAudio2SourceVoice_DestroyVoice(src); + IXAudio2MasteringVoice_DestroyVoice(master); + HeapFree(GetProcessHeap(), 0, (void*)buf.pAudioData); } static UINT32 test_DeviceDetails(IXAudio27 *xa)