From 684d11421c30c0f8230ccbcc8dcc94a457eb5f44 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Mon, 18 Dec 2023 10:44:25 -0800 Subject: [PATCH] d3d12: Only destroy the winsys during screen destruction, not reset Fixes: 81c8e89f ("d3d12: Fix screen->winsys leak in d3d12_screen") Part-of: (cherry picked from commit 325fb6e26b62326c86514d263ffedd241fd36865) --- .pick_status.json | 2 +- src/gallium/drivers/d3d12/d3d12_screen.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index a6307c1..2056ada 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -414,7 +414,7 @@ "description": "d3d12: Only destroy the winsys during screen destruction, not reset", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "81c8e89ff8e846839fffc1d103b2080bef5c1b5c", "notes": null diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp index ee74cf2..9b0233f 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp @@ -735,15 +735,15 @@ d3d12_deinit_screen(struct d3d12_screen *screen) screen->dev->Release(); screen->dev = nullptr; } - if (screen->winsys) { - screen->winsys->destroy(screen->winsys); - screen->winsys = nullptr; - } } void d3d12_destroy_screen(struct d3d12_screen *screen) { + if (screen->winsys) { + screen->winsys->destroy(screen->winsys); + screen->winsys = nullptr; + } slab_destroy_parent(&screen->transfer_pool); mtx_destroy(&screen->submit_mutex); mtx_destroy(&screen->descriptor_pool_mutex); -- 2.7.4