Skip to content

common: fix udev-based device removal

libgudev allocs a new GUdevDevice object for each event, so the pointer value for the 'add' udev event differs from the one for the 'remove' event. If we use the pointer value as hash table key, we'll never remove the device.

This would make the usage of a hashtable for the devices unnecessary because everything but the insert operation needs an iterator now. But with the hashtable we get 'free' storage for the syspath by just increasing the udev refcount instead of having to copy the string into our device.

Fixes #309 (closed)

Merge request reports