Bug List
globalScope> Global libinput_unref (struct libinput *libinput)
When the refcount reaches zero, libinput_unref() releases resources even if a caller still holds refcounted references to related resources (e.g. a libinput_device). When libinput_unref() returns NULL, the caller must consider any resources related to that context invalid. See https://bugs.freedesktop.org/show_bug.cgi?id=91872. Example code:
1 li = libinput_path_create_context(&interface, NULL);
2 device = libinput_path_add_device(li, "/dev/input/event0");
3 // get extra reference to device
4 libinput_device_ref(device);
5 
6 // refcount reaches 0, so *all* resources are cleaned up,
7 // including device
8 libinput_unref(li);
9 
10 // INCORRECT: device has been cleaned up and must not be used
11 // li = libinput_device_get_context(device);