[Bf-blender-cvs] [7c3cd63f95f] master: Fix T102085: X11 Startup crash

Anton Raves noreply at git.blender.org
Thu Oct 27 21:29:08 CEST 2022


Commit: 7c3cd63f95f8cb54aece57b4a4788abd10a11253
Author: Anton Raves
Date:   Thu Oct 27 13:29:03 2022 -0600
Branches: master
https://developer.blender.org/rB7c3cd63f95f8cb54aece57b4a4788abd10a11253

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.

===================================================================

M	intern/ghost/intern/GHOST_SystemWayland.cpp

===================================================================

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);



More information about the Bf-blender-cvs mailing list