summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2020-09-29 14:07:18 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2020-09-29 14:57:38 +0100
commit1b7e601867d48dc793a13c0a0b24af871efdfd4b (patch)
tree0969a9ccecfed793ec862c4820266c648de37b7a
parent9f0825c3169047da75d3fe91a3cb02bfe6fb7f25 (diff)
downloadcheese-1b7e601867d48dc793a13c0a0b24af871efdfd4b.tar.gz
libcheese: Fix critical on failing to load cropping cursor
Loading a cursor can fail (`gdk_cursor_new_for_display()` can return `NULL`); avoid a critical warning in that case. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-rw-r--r--libcheese/um-crop-area.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcheese/um-crop-area.c b/libcheese/um-crop-area.c
index 7695dcf1..42c81b99 100644
--- a/libcheese/um-crop-area.c
+++ b/libcheese/um-crop-area.c
@@ -474,7 +474,7 @@ update_cursor (UmCropArea *area,
GdkCursor *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);
+ g_clear_object (&cursor);
priv->current_cursor = cursor_type;
}
}