wayland: Allow a NULL inhibitors hash table
authorEmmanuele Bassi <ebassi@gnome.org>
Mon, 23 Apr 2018 09:57:07 +0000 (10:57 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Mon, 23 Apr 2018 09:57:07 +0000 (10:57 +0100)
commitfc57d3b5a33504a43b5e5877a69b193ebdb240eb
tree520dd99758ebe37d12cc356f55e15439f8b16caf
parent9178f7406768ae11280eaf1f8ff523711de572b1
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.
gdk/wayland/gdksurface-wayland.c