[gtk/wip/otte/gl-hdr: 4/12] surface: Use g_clear_thing()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/gl-hdr: 4/12] surface: Use g_clear_thing()
- Date: Mon, 4 Oct 2021 01:28:42 +0000 (UTC)
commit 5967f7535ef8ef816207fa4419e6acf234152f33
Author: Benjamin Otte <otte redhat com>
Date: Fri Sep 24 19:43:15 2021 +0200
surface: Use g_clear_thing()
gdk/gdksurface.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index d2031eaf8f..53c98c9158 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -710,22 +710,14 @@ gdk_surface_finalize (GObject *object)
_gdk_surface_destroy (surface, FALSE);
}
- if (surface->input_region)
- cairo_region_destroy (surface->input_region);
-
- if (surface->cursor)
- g_object_unref (surface->cursor);
-
- if (surface->device_cursor)
- g_hash_table_destroy (surface->device_cursor);
-
- if (surface->devices_inside)
- g_list_free (surface->devices_inside);
+ g_clear_pointer (&surface->input_region, cairo_region_destroy);
+ g_clear_object (&surface->cursor);
+ g_clear_pointer (&surface->device_cursor, g_hash_table_destroy);
+ g_clear_pointer (&surface->devices_inside, g_list_free);
g_clear_object (&surface->display);
- if (surface->opaque_region)
- cairo_region_destroy (surface->opaque_region);
+ g_clear_pointer (&surface->opaque_region, cairo_region_destroy);
if (surface->parent)
surface->parent->children = g_list_remove (surface->parent->children, surface);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]