Commit e741adb8 authored by Sebastian Keller's avatar Sebastian Keller
Browse files

backends/x11: Only free cursor if it was created successfully

XcursorLibraryLoadCursor can return 'None' if the current cursor theme
is missing the requested icon. If XFreeCursor is then called on this
cursor, it generates a BadCursor error causing gnome-shell to crash.

Fixes #254
parent deb541ef
......@@ -1483,7 +1483,9 @@ meta_x11_display_reload_cursor (MetaX11Display *x11_display)
XDefineCursor (x11_display->xdisplay, x11_display->xroot, xcursor);
XFlush (x11_display->xdisplay);
XFreeCursor (x11_display->xdisplay, xcursor);
if (xcursor)
XFreeCursor (x11_display->xdisplay, xcursor);
static void
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment