From 9a927f21fbd76a083bb2d0477b963949c9abe187 Mon Sep 17 00:00:00 2001 From: Sil Vilerino Date: Fri, 1 Dec 2023 13:14:09 -0500 Subject: [PATCH] vl_winsys_win32: call winsys->destroy(winsys) in error conditions Reviewed-by: Jesse Natalie Part-of: --- src/gallium/auxiliary/vl/vl_winsys_win32.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/auxiliary/vl/vl_winsys_win32.c b/src/gallium/auxiliary/vl/vl_winsys_win32.c index b4f7aefe1a4..349e610ba69 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_win32.c +++ b/src/gallium/auxiliary/vl/vl_winsys_win32.c @@ -78,6 +78,8 @@ vl_win32_screen_create(LUID *adapter) return &vscreen->base; release_pipe: + if(winsys) + winsys->destroy(winsys); vl_win32_screen_destroy(&vscreen->base); return NULL; } @@ -106,6 +108,8 @@ vl_win32_screen_create_from_d3d12_device(IUnknown* d3d12_device) return &vscreen->base; release_pipe: + if(winsys) + winsys->destroy(winsys); vl_win32_screen_destroy(&vscreen->base); return NULL; }