pywayland icon indicating copy to clipboard operation
pywayland copied to clipboard

Signal keeps references to removed Listeners

Open heuer opened this issue 2 years ago • 1 comments

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

heuer avatar Apr 12 '24 06:04 heuer

… 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

heuer avatar Apr 12 '24 09:04 heuer