From 7c3cd63f95f8cb54aece57b4a4788abd10a11253 Mon Sep 17 00:00:00 2001 From: Anton Raves Date: Thu, 27 Oct 2022 13:29:03 -0600 Subject: 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. --- intern/ghost/intern/GHOST_SystemWayland.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp index d4eabfb815d..0f609395124 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cpp +++ b/intern/ghost/intern/GHOST_SystemWayland.cpp @@ -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); -- cgit v1.2.3