FIX: Disconnect the value signal when removing a listener from a connection #1208
+139
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Addresses #1186.
When calling set_channel on a PyDMWidget, the process is:
PyDMConnection
associated with the addressPyDMConnection
for that address entirelyThe problem in #1186 seems to be that the
value_signal
is not disconnected, so if there is still an active listener such that the connection is not closed out entirely, that signal remains active and will continue to send even though the channel should have been replaced.This should fix it by ensuring the
value_signal
is disconnected as part ofremove_listener
along with all the other signals.Testing
Made a display that reproduced #1186. Manually verified that the problem went away after this PR. Added new unit tests, including one that does fail prior to this PR and passes now.