[PATCH] xaudio2/tests: Fix memory leaks

Andrew Eikum aeikum at codeweavers.com
Fri Oct 30 08:55:39 CDT 2015


Spotted by Nikolay Sivov.

Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
---
 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 3f03cc6..c7ae982 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)
-- 
2.6.2




More information about the wine-patches mailing list