summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2018-04-23 10:02:43 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2018-04-23 10:02:43 +0100
commit88b08c05c0b93fcdb00f35f91d51745b2e6d667f (patch)
tree7e55ce76c14fa2832c71f0de4d8e4985087c59a9
parentdad773b1295f571b69c122a7747f7d443ae8ca44 (diff)
downloadgtk+-88b08c05c0b93fcdb00f35f91d51745b2e6d667f.tar.gz
wayland: Allow a NULL inhibitors hash table
The shortcuts inhibitors hash table is created when we create a GdkWaylandWindow implementation for a GdkWindow, and it's destroyed once we finalize the instance. The fake "root" window we create for the Wayland display does not have a backing native window, so the shortcuts inhibitors hash table is set to NULL; this causes a critical error message when calling g_hash_table_destroy() on it. The finalization of the root window happens when we close a display connection. We should use g_clear_pointer(), instead, as it's NULL safe. Without this change, the displayclose test fails, as all warnings are considered fatal.
-rw-r--r--gdk/wayland/gdkwindow-wayland.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 2452337039..5a2fdf0223 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -999,7 +999,7 @@ gdk_window_impl_wayland_finalize (GObject *object)
g_clear_pointer (&impl->input_region, cairo_region_destroy);
g_clear_pointer (&impl->staged_updates_region, cairo_region_destroy);
- g_hash_table_destroy (impl->shortcuts_inhibitors);
+ g_clear_pointer (&impl->shortcuts_inhibitors, g_hash_table_unref);
G_OBJECT_CLASS (_gdk_window_impl_wayland_parent_class)->finalize (object);
}