Thomas Faber : quartz/tests: Fix memory leaks.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 28 20:50:43 CDT 2014


Module: wine
Branch: master
Commit: cf45bec65b6ae1db6f4f96cf44eaa7f98026a9a1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cf45bec65b6ae1db6f4f96cf44eaa7f98026a9a1

Author: Thomas Faber <thomas.faber at reactos.org>
Date:   Sat Jul 26 23:52:29 2014 +0200

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




More information about the wine-cvs mailing list