diff options
author | Philip Withnall <pwithnall@endlessos.org> | 2020-09-29 14:59:42 +0100 |
---|---|---|
committer | Robert Ancell <robert.ancell@gmail.com> | 2020-11-02 21:41:03 +0000 |
commit | e522e5e732e1697d531a0b3fc2129c90ccd5e92e (patch) | |
tree | d1ef99a349769a8b596339469595d52a906096d9 | |
parent | 243ff6a5111e4ff7a117b06501167cf5c37e7fb6 (diff) | |
download | gnome-control-center-e522e5e732e1697d531a0b3fc2129c90ccd5e92e.tar.gz |
wacom: 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>
-rw-r--r-- | panels/wacom/calibrator/calibrator-gui.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/panels/wacom/calibrator/calibrator-gui.c b/panels/wacom/calibrator/calibrator-gui.c index caff030c8..012291f8b 100644 --- a/panels/wacom/calibrator/calibrator-gui.c +++ b/panels/wacom/calibrator/calibrator-gui.c @@ -309,7 +309,7 @@ calib_area_new (GdkScreen *screen, GdkMonitor *monitor; #ifndef FAKE_AREA GdkWindow *window; - GdkCursor *cursor; + g_autoptr(GdkCursor) cursor = NULL; #endif /* FAKE_AREA */ GtkGesture *press; @@ -344,7 +344,6 @@ calib_area_new (GdkScreen *screen, window = gtk_widget_get_window (calib_area->window); cursor = gdk_cursor_new_for_display (gdk_display_get_default (), GDK_BLANK_CURSOR); gdk_window_set_cursor (window, cursor); - g_object_unref (cursor); gtk_widget_set_can_focus (calib_area->window, TRUE); gtk_window_set_keep_above (GTK_WINDOW (calib_area->window), TRUE); |