From 066221a9f955f6353e7019e47cc51d45060134ad Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Tue, 3 Jan 2023 22:56:51 +0800 Subject: [PATCH] d2d1/tests: Fix memory leaks. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53995 --- dlls/d2d1/tests/d2d1.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index bfa28ead732..93a8c6b43b8 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -6154,6 +6154,7 @@ static void test_hwnd_target(BOOL d3d11) D2D1_SIZE_U size; unsigned int i; HRESULT hr; + ULONG ref; static const struct format_test { @@ -6235,6 +6236,8 @@ static void test_hwnd_target(BOOL d3d11) { todo_wine ok(FAILED(hr), "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + ID2D1HwndRenderTarget_Release(rt); winetest_pop_context(); continue; } @@ -6251,7 +6254,8 @@ static void test_hwnd_target(BOOL d3d11) } DestroyWindow(hwnd_rt_desc.hwnd); - ID2D1Factory_Release(factory); + ref = ID2D1Factory_Release(factory); + ok(!ref, "Factory has %lu references left.\n", ref); } #define test_compatible_target_size(r) test_compatible_target_size_(__LINE__, r) -- 2.11.4.GIT