From: Józef Kucia jkucia@codeweavers.com
Fixes a race condition.
For bug 44557.
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/swapchain.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 7a3f1ff95e90..9df40abc70ce 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -135,6 +135,8 @@ void * CDECL wined3d_swapchain_get_parent(const struct wined3d_swapchain *swapch
void CDECL wined3d_swapchain_set_window(struct wined3d_swapchain *swapchain, HWND window) { + struct wined3d_device *device = swapchain->device; + if (!window) window = swapchain->device_window; if (window == swapchain->win_handle) @@ -142,6 +144,9 @@ void CDECL wined3d_swapchain_set_window(struct wined3d_swapchain *swapchain, HWN
TRACE("Setting swapchain %p window from %p to %p.\n", swapchain, swapchain->win_handle, window); + + device->cs->ops->finish(device->cs, WINED3D_CS_QUEUE_DEFAULT); + swapchain->win_handle = window; }