A listener's link shouldn't be removed more than one time from the
signal's wl_list, but it can, and doing so leads to crashes. The
existing logic seems to imply that wl_list_remove leaves the link as a
NULL pointer, blocking subsequent removals. However, the Wayland docs
state "Note: This operation leaves elm [the link] in an invalid state.
" Instead of relying on that, we should set the object's pointer to
None and use that to block subsequent removals.
Also, the self.link attribute looks like forgotten code that should have been removed.
A listener's link shouldn't be removed more than one time from the signal's wl_list, but it can, and doing so leads to crashes. The existing logic seems to imply that
wl_list_remove
leaves the link as a NULL pointer, blocking subsequent removals. However, the Wayland docs state "Note: This operation leaves elm [the link] in an invalid state. " Instead of relying on that, we should set the object's pointer toNone
and use that to block subsequent removals.Also, the
self.link
attribute looks like forgotten code that should have been removed.