https://bugs.freedesktop.org/show_bug.cgi?id=91872
Bug ID: 91872
Summary: libinput context refcounting frees memory early
Product: Wayland
Version: unspecified
Hardware: Other
OS: All
Status: ASSIGNED
Severity: normal
Priority: medium
Component: libinput
Assignee: [email protected]
Reporter: [email protected]
The refcounting on the context itself does not take client-held references in
the child structs into account.
Pseudocode example:
li = libinput_path_create_context(&interface, NULL);
device = libinput_path_add_device(li, "/dev/input/event0");
libinput_device_ref(device);
libinput_unref(li); <--- resources are cleaned up
The device has a refcount of at least 1 on cleanup, the client has access to
the struct and could, in the future, try to call libinput_device_get_context().
However, the libinput context is cleaned up and all devices are removed. The
device the client has a ref to points to a freed memory.
This also affects libinput_device_groups if the device is removed with a ref to
the group still handling. It does not affect seats, since the context always
has a ref to the seat and the bug simply isn't triggered.
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
wayland-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-bugs