flacjacket / pywayland

Python bindings for the libwayland library
Apache License 2.0
78 stars 16 forks source link

Signal keeps references to removed Listeners #61

Closed heuer closed 1 month ago

heuer commented 5 months ago

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 commented 5 months ago

… 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