On Tue, 18 Feb 2020 at 05:57, Zhiyi Zhang zzhang@codeweavers.com wrote:
+void CDECL wined3d_device_destroy_swapchain(struct wined3d_device *device, struct wined3d_swapchain *swapchain) +{
- if (device->swapchain_count && device->swapchains[0] == swapchain)
wined3d_device_uninit_3d(device);
- wined3d_cs_finish(device->cs, WINED3D_CS_QUEUE_DEFAULT);
- device->adapter->adapter_ops->adapter_destroy_swapchain(swapchain);
+}
I think the introduction of wined3d_device_destroy_swapchain in the public wined3d API is undesirable, but even more undesirable is the fact that it does something different from destroying the swapchain through wined3d_swapchain_decref().
I think you should simply avoid the issue by moving the code for handling fullscreen mode in d3d11_swapchain_init() to dxgi_swapchain_factory_create_swapchain(). If that were somehow not possible you could check whether parent initialisation is completely done in d3d11_swapchain_wined3d_object_released(), but I don't think that's the case.