mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
wgl: Check for stw_device->screen before trying to destroy it
The stw_device and its screen are set up independently. It's possible
to have a device without a screen if the DLL is loaded but never
called into, since DllMain for PROCESS_ATTACH sets up the stw_device,
but the screen is initialized later on the first call to get pixel
formats. If the DLL is loaded and then unloaded, don't crash.
Cc: mesa-stable
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27892>
(cherry picked from commit f96d31bc8a)
This commit is contained in:
parent
54cc1bd801
commit
8f15da8e97
2 changed files with 3 additions and 2 deletions
|
|
@ -2964,7 +2964,7 @@
|
|||
"description": "wgl: Check for stw_device->screen before trying to destroy it",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -258,7 +258,8 @@ stw_cleanup(void)
|
|||
st_screen_destroy(stw_dev->fscreen);
|
||||
FREE(stw_dev->fscreen);
|
||||
|
||||
stw_dev->screen->destroy(stw_dev->screen);
|
||||
if (stw_dev->screen)
|
||||
stw_dev->screen->destroy(stw_dev->screen);
|
||||
|
||||
stw_tls_cleanup();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue