pywayland
pywayland copied to clipboard
Signal keeps references to removed Listeners
The Listener.remove() method does not remove the listener from Signal._link.
Only elements are added to Signal._link, but never removed.
The following should hold true:
l = Listener(callback)
somesignal.add(l)
assert len(somesignal._link) == 1
l.remove()
assert len(somesignal._link) == 0
The 2nd assert throws an exception
… and the listener still keeps a reference to the signal after removal
l = Listener(callback)
somesignal.add(l)
assert l._signal is not None
l.remove()
assert l._signal is None # fails