quartz/tests: Fix memory leaks.

Thomas Faber thomas.faber at reactos.org
Sun Jul 27 09:13:02 CDT 2014


From 80da5685f789b9b2d91a790ba128e411f379e2d6 Mon Sep 17 00:00:00 2001
From: Thomas Faber <thomas.faber at reactos.org>
Date: Sat, 26 Jul 2014 23:52:29 +0200
Subject: quartz/tests: Fix memory leaks.

---
 dlls/quartz/tests/filtergraph.c    |  1 +
 dlls/quartz/tests/referenceclock.c | 10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c
index 713df7b..2f56151 100644
--- a/dlls/quartz/tests/filtergraph.c
+++ b/dlls/quartz/tests/filtergraph.c
@@ -1884,6 +1884,7 @@ START_TEST(filtergraph)
         skip("Creating filtergraph returned %08x, skipping tests\n", hr);
         return;
     }
+    IGraphBuilder_Release(pgraph);
     test_render_run(avifile);
     test_render_run(mpegfile);
     test_graph_builder();
diff --git a/dlls/quartz/tests/referenceclock.c b/dlls/quartz/tests/referenceclock.c
index a96bd48..eb6fbda 100644
--- a/dlls/quartz/tests/referenceclock.c
+++ b/dlls/quartz/tests/referenceclock.c
@@ -28,19 +28,21 @@
 static void test_IReferenceClock_query_interface(const char * clockdesc, IReferenceClock * pClock)
 {
     HRESULT hr;
-    IUnknown *pF;
+    void *pF;
 
-    hr = IReferenceClock_QueryInterface(pClock, &IID_IUnknown, (LPVOID *)&pF);
+    hr = IReferenceClock_QueryInterface(pClock, &IID_IUnknown, &pF);
     ok(hr == S_OK, "IReferenceClock_QueryInterface returned %x\n", hr);
     ok(pF != NULL, "pF is NULL\n");
+    if (SUCCEEDED(hr)) IUnknown_Release((IUnknown *)pF);
 
-    hr = IReferenceClock_QueryInterface(pClock, &IID_IDirectDraw, (LPVOID *)&pF);
+    hr = IReferenceClock_QueryInterface(pClock, &IID_IDirectDraw, &pF);
     ok(hr == E_NOINTERFACE, "IReferenceClock_QueryInterface returned %x\n", hr);
     ok(pF == NULL, "pF is not NULL\n");
 
-    hr = IReferenceClock_QueryInterface(pClock, &IID_IReferenceClock, (LPVOID *)&pF);
+    hr = IReferenceClock_QueryInterface(pClock, &IID_IReferenceClock, &pF);
     ok(hr == S_OK, "IReferenceClock_QueryInterface returned %x\n", hr);
     ok(pF != NULL, "pF is NULL\n");
+    if (SUCCEEDED(hr)) IReferenceClock_Release((IReferenceClock *)pF);
 }
 
 /* The following method expects a reference clock that will keep ticking for
-- 
1.9.0.msysgit.0



More information about the wine-patches mailing list