Commit 3eebc3ea authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

dxgi/tests: Release the swapchain after waiting for the window thread to finish…

dxgi/tests: Release the swapchain after waiting for the window thread to finish in test_resize_target_wndproc(). In order to prevent resize_target_wndproc() from potentially accessing the swapchain after it has been destroyed.
parent 4e1a3cc8
...@@ -3523,12 +3523,6 @@ static void test_resize_target_wndproc(IUnknown *device, BOOL is_d3d12) ...@@ -3523,12 +3523,6 @@ static void test_resize_target_wndproc(IUnknown *device, BOOL is_d3d12)
hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL); hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
refcount = IDXGISwapChain_Release(swapchain);
ok(!refcount, "IDXGISwapChain has %lu references left.\n", refcount);
refcount = IDXGIFactory_Release(factory);
ok(refcount == !is_d3d12, "Got unexpected refcount %lu.\n", refcount);
ret = SetEvent(thread_data.finished); ret = SetEvent(thread_data.finished);
ok(ret, "Failed to set event, last error %#lx.\n", GetLastError()); ok(ret, "Failed to set event, last error %#lx.\n", GetLastError());
ret = WaitForSingleObject(thread, INFINITE); ret = WaitForSingleObject(thread, INFINITE);
...@@ -3536,6 +3530,12 @@ static void test_resize_target_wndproc(IUnknown *device, BOOL is_d3d12) ...@@ -3536,6 +3530,12 @@ static void test_resize_target_wndproc(IUnknown *device, BOOL is_d3d12)
CloseHandle(thread); CloseHandle(thread);
CloseHandle(thread_data.window_created); CloseHandle(thread_data.window_created);
CloseHandle(thread_data.finished); CloseHandle(thread_data.finished);
refcount = IDXGISwapChain_Release(swapchain);
ok(!refcount, "IDXGISwapChain has %lu references left.\n", refcount);
refcount = IDXGIFactory_Release(factory);
ok(refcount == !is_d3d12, "Got unexpected refcount %lu.\n", refcount);
} }
static void test_inexact_modes(void) static void test_inexact_modes(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment