Commit 9ba058e9 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Send vertex declaration destruction through the command stream.

parent 87f667b4
...@@ -50,6 +50,14 @@ ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration ...@@ -50,6 +50,14 @@ ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration
return refcount; return refcount;
} }
static void wined3d_vertex_declaration_destroy_object(void *object)
{
struct wined3d_vertex_declaration *declaration = object;
HeapFree(GetProcessHeap(), 0, declaration->elements);
HeapFree(GetProcessHeap(), 0, declaration);
}
ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration) ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)
{ {
ULONG refcount = InterlockedDecrement(&declaration->ref); ULONG refcount = InterlockedDecrement(&declaration->ref);
...@@ -58,9 +66,9 @@ ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration ...@@ -58,9 +66,9 @@ ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration
if (!refcount) if (!refcount)
{ {
HeapFree(GetProcessHeap(), 0, declaration->elements);
declaration->parent_ops->wined3d_object_destroyed(declaration->parent); declaration->parent_ops->wined3d_object_destroyed(declaration->parent);
HeapFree(GetProcessHeap(), 0, declaration); wined3d_cs_emit_destroy_object(declaration->device->cs,
wined3d_vertex_declaration_destroy_object, declaration);
} }
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