I don't think this explanation makes sense. Before the implicit swapchain destroys its own buffers, it should call wined3d_device_uninit_3d(), which in turn sets device->d3d_initialized to FALSE. At that point texture_resource_unload() will not try to acquire a context. Why isn't this mechanism working?