diff --git a/src/core/display.c b/src/core/display.c index 041393b06..147cb82b7 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1709,7 +1709,8 @@ meta_display_set_grab_op_cursor (MetaDisplay *display, cursor_ref = meta_cursor_reference_from_theme (cursor); meta_cursor_tracker_set_grab_cursor (tracker, cursor_ref); - meta_cursor_reference_unref (cursor_ref); + if (cursor_ref) + meta_cursor_reference_unref (cursor_ref); if (meta_backend_grab_device (backend, META_VIRTUAL_CORE_POINTER_ID, timestamp)) display->grab_have_pointer = TRUE; diff --git a/src/core/screen.c b/src/core/screen.c index e1dc6cd1f..6ceab4705 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -1376,7 +1376,8 @@ meta_screen_update_cursor (MetaScreen *screen) cursor_ref = meta_cursor_reference_from_theme (cursor); meta_cursor_tracker_set_root_cursor (tracker, cursor_ref); - meta_cursor_reference_unref (cursor_ref); + if (cursor_ref) + meta_cursor_reference_unref (cursor_ref); /* Set a cursor for X11 applications that don't specify their own */ xcursor = meta_display_create_x_cursor (display, cursor);