Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes subscription to _deviceConnector.deviceConnectionStateUpdateStream leaking #876

Merged

Conversation

gabrielgarciagava
Copy link
Contributor

  • Previous code would create a broadcastStream from a normal stream (created by Repeater). When this is done, the source stream subscription needs to be explicitly closed. This is usually done by implementing the onCancel callback from the asBroadcastStream method. This was not happening, so every call to connectedDeviceStream was creating a new subscription that was never closed.
  • To fix the problem, this commit uses the Repeater.broadcast constructor which already returns a broadcast stream and also closes the source stream subscription when needed

…eam leaking

- Previous code would create a broadcastStream from a normal stream (created by Repeater).
When this is done, the source stream subscription needs to be explicitly closed.
This is usually done by implementing the onCancel callback from the asBroadcastStream method.
This was not happening, so every call to connectedDeviceStream was creating a new subscription that was never closed.
- To fix the problem, this commit uses the Repeater.broadcast constructor which already returns a broadcast stream
and also closes the source stream subscription when needed
@Taym95 Taym95 merged commit a6dd926 into PhilipsHue:master Jun 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants