wayland: Clean up scheduled_surface_associations hash table

Fixes memory leak:

==995170== 192 (96 direct, 96 indirect) bytes in 1 blocks are definitely lost in loss record 14,260 of 15,641
==995170==    at 0x483F7B5: malloc (vg_replace_malloc.c:381)
==995170==    by 0x4B21178: g_malloc (gmem.c:125)
==995170==    by 0x4B395C0: g_slice_alloc (gslice.c:1072)
==995170==    by 0x4B0766D: g_hash_table_new_full (ghash.c:1071)
==995170==    by 0x4A3F3A4: meta_wayland_compositor_init (meta-wayland.c:477)
==995170==    by 0x4E1F509: g_type_create_instance (gtype.c:1929)
==995170==    by 0x4E03DFC: g_object_new_internal (gobject.c:2011)
==995170==    by 0x4E0538C: g_object_new_with_properties (gobject.c:2181)
==995170==    by 0x4E05D40: g_object_new (gobject.c:1821)
==995170==    by 0x4A3F8C4: meta_wayland_compositor_new (meta-wayland.c:590)
==995170==    by 0x49C7FA7: meta_context_start (meta-context.c:412)
==995170==    by 0x10F065: main (mutter.c:148)

Fixes: 8df2a1452c ("wayland: Notify actively of xwayland window/surface associations")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2527>
This commit is contained in:
Michel Dänzer 2022-07-23 16:42:56 +02:00 committed by Marge Bot
parent 39fd32c362
commit 4ddefb9a69

View File

@ -448,6 +448,8 @@ meta_wayland_compositor_finalize (GObject *object)
MetaBackend *backend = meta_context_get_backend (compositor->context); MetaBackend *backend = meta_context_get_backend (compositor->context);
ClutterActor *stage = meta_backend_get_stage (backend); ClutterActor *stage = meta_backend_get_stage (backend);
g_hash_table_destroy (compositor->scheduled_surface_associations);
g_signal_handlers_disconnect_by_func (stage, on_after_update, compositor); g_signal_handlers_disconnect_by_func (stage, on_after_update, compositor);
g_signal_handlers_disconnect_by_func (stage, on_presented, compositor); g_signal_handlers_disconnect_by_func (stage, on_presented, compositor);