[PATCH 2/2] d2d1/tests: Test unregistering effect which has existing instance.

Ziqing Hui zhui at codeweavers.com
Thu Jun 2 02:28:58 CDT 2022


Signed-off-by: Ziqing Hui <zhui at codeweavers.com>
---
 dlls/d2d1/tests/d2d1.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index ae1cc9f553d..8116e117bc2 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -10673,10 +10673,15 @@ static void test_effect_register(BOOL d3d11)
         ok(hr == test->hr, "Got unexpected hr %#lx, expected %#lx.\n", hr, test->hr);
         if (hr == S_OK)
         {
+            effect = NULL;
+            hr = ID2D1DeviceContext_CreateEffect(device_context, &CLSID_TestEffect, &effect);
+            todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
             hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
             todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
             hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect);
             todo_wine ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr);
+            if (effect)
+                ID2D1Effect_Release(effect);
         }
 
         winetest_pop_context();
-- 
2.25.1




More information about the wine-devel mailing list