mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
backends/x11: Fix use after free on device removal
The devices_by_id hash table is responsible for managing the reference to the devices. In remove_device however, for non-core devices there are additional calls to dispose/unref, after the last reference has already been dropped by the hash table. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1032
This commit is contained in:
parent
ffad55c66f
commit
81de2c2913
@ -698,12 +698,11 @@ remove_device (MetaSeatX11 *seat_x11,
|
||||
{
|
||||
seat_x11->devices = g_list_remove (seat_x11->devices, device);
|
||||
g_signal_emit_by_name (seat_x11, "device-removed", device);
|
||||
g_hash_table_remove (seat_x11->devices_by_id,
|
||||
GINT_TO_POINTER (device_id));
|
||||
}
|
||||
|
||||
g_object_run_dispose (G_OBJECT (device));
|
||||
g_object_unref (device);
|
||||
g_hash_table_remove (seat_x11->devices_by_id,
|
||||
GINT_TO_POINTER (device_id));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user