Commit 97eb3595 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Send query destruction through the command stream.

parent 9ba058e9
...@@ -233,14 +233,10 @@ ULONG CDECL wined3d_query_incref(struct wined3d_query *query) ...@@ -233,14 +233,10 @@ ULONG CDECL wined3d_query_incref(struct wined3d_query *query)
return refcount; 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 /* Queries are specific to the GL context that created them. Not
* deleting the query will obviously leak it, but that's still better * deleting the query will obviously leak it, but that's still better
* than potentially deleting a different query with the same id in this * than potentially deleting a different query with the same id in this
...@@ -267,7 +263,16 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) ...@@ -267,7 +263,16 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
} }
HeapFree(GetProcessHeap(), 0, 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; return refcount;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment