<p dir="ltr">03.10.2016 3:47 PM "Henri Verbeet" <<a href="mailto:hverbeet@gmail.com">hverbeet@gmail.com</a>>:<br>
> I think it may be harder to fix than this. If state_unbind_resources()<br>
> can end up destroying the (primary) swapchain, it's not safe to call<br>
> context_acquire() afterwards. Which means it's unsafe to unload<br>
> resources or even unload a different SRV. The reason destroying the<br>
> RTVs is currently safe, is that we unloaded resources earlier, so<br>
> releasing the references to the resources for those views shouldn't<br>
> acquire a context to destroy e.g. the GL texture again, but that's<br>
> already more fragile than I'd like. Perhaps we should just delay<br>
> destroying the context until leaving the last level.</p>
<p dir="ltr">I think this fix is correct. The device keeps a reference to the implicit swapchain. The implicit swapchain is destroyed just before leaving from wined3d_device_uninit_3d() so it should be safe to call context_acquire().</p>
<p dir="ltr">This problem occurs only for additional swapchains and that's why it happens only in test_swapchain_flip().<br>
</p>