Nikolay Sivov : dwrite/tests: Fix some leaks (Valgrind).

Alexandre Julliard julliard at winehq.org
Fri Dec 14 11:57:12 CST 2018


Module: wine
Branch: master
Commit: 75b02759b0528ecda05ff4865f6c06dda1ac6410
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=75b02759b0528ecda05ff4865f6c06dda1ac6410

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Fri Dec 14 03:05:26 2018 +0300

dwrite/tests: Fix some leaks (Valgrind).

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dwrite/tests/font.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/dlls/dwrite/tests/font.c b/dlls/dwrite/tests/font.c
index f752afd..aa1562e 100644
--- a/dlls/dwrite/tests/font.c
+++ b/dlls/dwrite/tests/font.c
@@ -1778,6 +1778,7 @@ static void test_CreateFontFace(void)
     UINT32 count;
     WCHAR *path;
     HRESULT hr;
+    ULONG ref;
 
     factory = create_factory();
 
@@ -1864,6 +1865,8 @@ static void test_CreateFontFace(void)
     IDWriteFont_Release(font);
     IDWriteFontFamily_Release(family);
     IDWriteFontCollection_Release(collection);
+    ref = IDWriteFactory_Release(factory);
+    ok(ref == 0, "factory not released, %u.\n", ref);
 
     /* IDWriteFactory::CreateFontFace() */
     path = create_testfontfile(test_fontfile);
@@ -1929,7 +1932,8 @@ todo_wine
     }
 
     IDWriteFontFile_Release(file);
-    IDWriteFactory_Release(factory);
+    ref = IDWriteFactory_Release(factory);
+    ok(ref == 0, "factory not released, %u.\n", ref);
     DELETE_FONTFILE(path);
 }
 
@@ -4873,6 +4877,7 @@ static void test_IsMonospacedFont(void)
     ULONG ref;
 
     factory = create_factory();
+
     hr = IDWriteFactory_GetSystemFontCollection(factory, &collection, FALSE);
     ok(hr == S_OK, "got 0x%08x\n", hr);
 
@@ -4920,7 +4925,8 @@ static void test_IsMonospacedFont(void)
     else
         skip("Courier New font not found.\n");
 
-    ref = IDWriteFontCollection_Release(collection);
+    IDWriteFontCollection_Release(collection);
+    ref = IDWriteFactory_Release(factory);
     ok(ref == 0, "factory not released, %u\n", ref);
 }
 




More information about the wine-cvs mailing list