Fix T102085: X11 Startup crash

wl_registry_destroy does not enjoy being fed a null pointer.
Added a null check to keep it out of trouble.
This commit is contained in:
Anton Raves 2022-10-27 13:29:03 -06:00 committed by Ray Molenkamp
parent c967bdcbb1
commit 7c3cd63f95
Notes: blender-bot 2023-02-14 03:46:57 +01:00
Referenced by issue #102085, X11 Startup Crash
1 changed files with 4 additions and 2 deletions

View File

@ -806,8 +806,10 @@ struct GWL_Display {
static void gwl_display_destroy(GWL_Display *display)
{
wl_registry_destroy(display->wl_registry);
display->wl_registry = nullptr;
if (display->wl_registry) {
wl_registry_destroy(display->wl_registry);
display->wl_registry = nullptr;
}
/* Unregister items in reverse order. */
gwl_registry_entry_remove_all(display);