d3d12: Fix screen->winsys leak in d3d12_screen
authorSil Vilerino <sivileri@microsoft.com>
Fri, 1 Dec 2023 18:15:35 +0000 (13:15 -0500)
committerEric Engestrom <eric@engestrom.ch>
Fri, 8 Dec 2023 11:12:50 +0000 (11:12 +0000)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26456>
(cherry picked from commit 81c8e89ff8e846839fffc1d103b2080bef5c1b5c)

.pick_status.json
src/gallium/drivers/d3d12/d3d12_screen.cpp

index 4e06969..ce9fcb9 100644 (file)
         "description": "d3d12: Fix screen->winsys leak in d3d12_screen",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null,
         "notes": null
index 4377361..192d4d9 100644 (file)
@@ -735,6 +735,10 @@ 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