wined3d: Send query destruction through the command stream.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-06-22 10:39:03 +02:00 committed by Alexandre Julliard
parent 9ba058e94c
commit 97eb359588
1 changed files with 33 additions and 28 deletions

View File

@ -233,14 +233,10 @@ ULONG CDECL wined3d_query_incref(struct wined3d_query *query)
return refcount;
}
ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
static void wined3d_query_destroy_object(void *object)
{
ULONG refcount = InterlockedDecrement(&query->ref);
struct wined3d_query *query = object;
TRACE("%p decreasing refcount to %u.\n", query, refcount);
if (!refcount)
{
/* Queries are specific to the GL context that created them. Not
* deleting the query will obviously leak it, but that's still better
* than potentially deleting a different query with the same id in this
@ -269,6 +265,15 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
HeapFree(GetProcessHeap(), 0, query);
}
ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
{
ULONG refcount = InterlockedDecrement(&query->ref);
TRACE("%p decreasing refcount to %u.\n", query, refcount);
if (!refcount)
wined3d_cs_emit_destroy_object(query->device->cs, wined3d_query_destroy_object, query);
return refcount;
}