[cheese] libcheese: Fix critical on failing to load cropping cursor



commit 1b7e601867d48dc793a13c0a0b24af871efdfd4b
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue Sep 29 14:07:18 2020 +0100

    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>

 libcheese/um-crop-area.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
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;
         }
 }


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