user-accounts: Fix a critical warning if loading a cursor fails
It’s possible for `gdk_cursor_new_for_display()` to return `NULL`. It’s OK to pass `NULL` to `gdk_window_set_cursor()`, but not OK to then unref it. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
7bbbef5fde
commit
243ff6a511
1 changed files with 3 additions and 3 deletions
|
@ -352,10 +352,10 @@ update_cursor (CcCropArea *area,
|
|||
}
|
||||
|
||||
if (cursor_type != area->current_cursor) {
|
||||
GdkCursor *cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (area)),
|
||||
g_autoptr(GdkCursor) cursor = NULL;
|
||||
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (area)),
|
||||
cursor_type);
|
||||
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (area)), cursor);
|
||||
g_object_unref (cursor);
|
||||
area->current_cursor = cursor_type;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue