[gtk: 2/3] wayland: port code to g_clear_pointer
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 2/3] wayland: port code to g_clear_pointer
- Date: Mon, 18 Oct 2021 13:44:54 +0000 (UTC)
commit aa258fa17f8c9c176e57c2833bb28b2962d9577c
Author: David Edmundson <davidedmundson kde org>
Date: Fri Oct 1 13:31:39 2021 +0100
wayland: port code to g_clear_pointer
gdk/wayland/gdkdisplay-wayland.c | 6 +-----
gdk/wayland/gdksurface-wayland.c | 5 +----
2 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 4f70a3c833..4a547b80a6 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -697,11 +697,7 @@ gdk_wayland_display_finalize (GObject *object)
g_free (display_wayland->cursor_theme_name);
xkb_context_unref (display_wayland->xkb_context);
- if (display_wayland->cursor_theme)
- {
- wl_cursor_theme_destroy (display_wayland->cursor_theme);
- display_wayland->cursor_theme = NULL;
- }
+ g_clear_pointer (&display_wayland->cursor_theme, wl_cursor_theme_destroy);
g_list_store_remove_all (display_wayland->monitors);
g_object_unref (display_wayland->monitors);
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 53abdc2302..11dcf6e2bd 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -2303,10 +2303,7 @@ gdk_wayland_toplevel_uninhibit_idle (GdkToplevel *toplevel)
g_assert (impl->idle_inhibitor && impl->idle_inhibitor_refcount > 0);
if (--impl->idle_inhibitor_refcount == 0)
- {
- zwp_idle_inhibitor_v1_destroy (impl->idle_inhibitor);
- impl->idle_inhibitor = NULL;
- }
+ g_clear_pointer (&impl->idle_inhibitor, zwp_idle_inhibitor_v1_destroy);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]