[PATCH 4/7] wined3d: Avoid using destroyed context.

Józef Kucia joseph.kucia at gmail.com
Wed Oct 5 03:53:01 CDT 2016


On Tue, Oct 4, 2016 at 10:43 AM, Henri Verbeet <hverbeet at gmail.com> wrote:
> On 3 October 2016 at 17:27, Józef Kucia <joseph.kucia at gmail.com> wrote:
>> 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().
>>
>> This problem occurs only for additional swapchains and that's why it happens
>> only in test_swapchain_flip().
>
> You're probably right. (Although that's not to say the code wouldn't
> benefit from being a little more robust. I think it's hard to reason
> about.) Is state_unbind_shaders() required? I assume it's because
> unbinding the shaders needs to happen before destroying the shader
> backend, but would delaying the context_acquire() call until after the
> wine_rb_clear() call also work?

Yes, delaying context_acquire() would also work.



More information about the wine-devel mailing list