Module: wine Branch: master Commit: 9ba058e94c2662f5296c95adeafd29c59b137249 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9ba058e94c2662f5296c95adea...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Jun 22 10:39:02 2016 +0200
wined3d: Send vertex declaration destruction through the command stream.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/vertexdeclaration.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c index febd695..c8704e9 100644 --- a/dlls/wined3d/vertexdeclaration.c +++ b/dlls/wined3d/vertexdeclaration.c @@ -50,6 +50,14 @@ ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration 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 refcount = InterlockedDecrement(&declaration->ref); @@ -58,9 +66,9 @@ ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration
if (!refcount) { - HeapFree(GetProcessHeap(), 0, declaration->elements); 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;