From 82be8b676c8e588551c5b04a7f1996ee98655c41 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 7 Jul 2021 11:40:07 -0500 Subject: [PATCH] wined3d: Fix some memory leaks when destroying deferred contexts. Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/cs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 3062becb153..3593e5bfb48 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -3674,13 +3674,18 @@ void CDECL wined3d_deferred_context_destroy(struct wined3d_device_context *conte for (i = 0; i < deferred->resource_count; ++i) wined3d_resource_decref(deferred->resources[i]); + heap_free(deferred->resources); for (i = 0; i < deferred->upload_count; ++i) { wined3d_resource_decref(deferred->uploads[i].resource); heap_free(deferred->uploads[i].sysmem); } - heap_free(deferred->resources); + heap_free(deferred->uploads); + + for (i = 0; i < deferred->command_list_count; ++i) + wined3d_command_list_decref(deferred->command_lists[i]); + heap_free(deferred->command_lists); wined3d_state_destroy(deferred->c.state); heap_free(deferred->data);