wayland: Ensure tablet objects tear down resources properly
Otherwise the resource is still linked to a wl_list whose storage has been freed, leading to invalid writes.
This commit is contained in:
parent
2c13ae2b59
commit
ccf6dcd865
@ -192,6 +192,14 @@ meta_wayland_tablet_seat_new (MetaWaylandTabletManager *manager)
|
||||
void
|
||||
meta_wayland_tablet_seat_free (MetaWaylandTabletSeat *tablet_seat)
|
||||
{
|
||||
struct wl_resource *resource, *next;
|
||||
|
||||
wl_resource_for_each_safe (resource, next, &tablet_seat->resource_list)
|
||||
{
|
||||
wl_list_remove (wl_resource_get_link (resource));
|
||||
wl_list_init (wl_resource_get_link (resource));
|
||||
}
|
||||
|
||||
g_signal_handlers_disconnect_by_data (tablet_seat->device_manager,
|
||||
tablet_seat);
|
||||
g_hash_table_destroy (tablet_seat->tablets);
|
||||
|
@ -411,6 +411,8 @@ meta_wayland_tablet_tool_free (MetaWaylandTabletTool *tool)
|
||||
wl_resource_for_each_safe (resource, next, &tool->resource_list)
|
||||
{
|
||||
zwp_tablet_tool_v1_send_removed (resource);
|
||||
wl_list_remove (wl_resource_get_link (resource));
|
||||
wl_list_init (wl_resource_get_link (resource));
|
||||
}
|
||||
|
||||
g_slice_free (MetaWaylandTabletTool, tool);
|
||||
|
@ -62,6 +62,8 @@ meta_wayland_tablet_free (MetaWaylandTablet *tablet)
|
||||
wl_resource_for_each_safe (resource, next, &tablet->resource_list)
|
||||
{
|
||||
zwp_tablet_v1_send_removed (resource);
|
||||
wl_list_remove (wl_resource_get_link (resource));
|
||||
wl_list_init (wl_resource_get_link (resource));
|
||||
}
|
||||
|
||||
g_slice_free (MetaWaylandTablet, tablet);
|
||||
|
Loading…
Reference in New Issue
Block a user