Or call it twice on one which has.
This fixes a crash in Mafia: Definitive Edition.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/query.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index 24892e42b34..8ee7ae07886 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -1661,7 +1661,6 @@ static BOOL wined3d_query_vk_issue(struct wined3d_query *query, uint32_t flags) { context_vk = wined3d_context_vk(context_acquire(&device_vk->d, NULL, 0));
- list_remove(&query_vk->entry); if (query_vk->pending_count) wined3d_context_vk_remove_pending_queries(context_vk, query_vk); memset((void *)query->data, 0, query->data_size); @@ -1742,7 +1741,8 @@ static void wined3d_query_vk_destroy(struct wined3d_query *query) struct wined3d_query_vk *query_vk = wined3d_query_vk(query); struct wined3d_context_vk *context_vk;
- list_remove(&query_vk->entry); + if (query_vk->flags & WINED3D_QUERY_VK_FLAG_STARTED) + list_remove(&query_vk->entry); if (query_vk->pending_count) { context_vk = wined3d_context_vk(context_acquire(query_vk->q.device, NULL, 0)); @@ -1942,7 +1942,6 @@ HRESULT wined3d_query_vk_create(struct wined3d_device *device, enum wined3d_quer data = query_vk + 1;
wined3d_query_init(&query_vk->q, device, type, data, data_size, ops, parent, parent_ops); - list_init(&query_vk->entry);
switch (type) {