[gtk/fix-x11-cursor-crash] x11: Only update cursors if we have any



commit bf2c29a36a979e3e09f3e54d96c33714ea23b162
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Dec 13 14:46:00 2019 -0500

    x11: Only update cursors if we have any
    
    We were accessing an on-demand created hash table
    without checking if it had been created first.
    
    Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2308

 gdk/x11/gdkcursor-x11.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c
index e0de28ed90..6f2682dc40 100644
--- a/gdk/x11/gdkcursor-x11.c
+++ b/gdk/x11/gdkcursor-x11.c
@@ -305,6 +305,9 @@ gdk_x11_display_set_cursor_theme (GdkDisplay  *display,
   if (size > 0)
     XcursorSetDefaultSize (xdisplay, size);
 
+  if (GDK_X11_DISPLAY (display)->cursors == NULL)
+    return;
+
   g_hash_table_iter_init (&iter, GDK_X11_DISPLAY (display)->cursors);
   while (g_hash_table_iter_next (&iter, &cursor, &xcursor))
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]