-
Notifications
You must be signed in to change notification settings - Fork 11
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
EventFlux instance should have dispose() or close() method #12
Comments
Doesn't closing the client, automatically close this data stream as well? Also there's no close/disconnect method for |
When calling .listen(...) on a stream, a StreamSubscription is created: https://api.flutter.dev/flutter/dart-async/StreamSubscription-class.html This subscription should be cancelled once it is not needed anymore. For example, once the connection is lost and we have to reconnect, I think this code is called again, and a new subscription is created. (IIRC - please double check though 😄) But in general, its a good practice to keep track of stream subscriptions, and cancel them on dispose(). |
@jangruenwaldt Thanks for the resource, I found it useful. I found what you were mentioning. I've fixed it. Should be available in the next release. |
Keeping this issue open still the fix is released. |
This is fixed on the latest version of EventFlux, v1.7.0. |
For example, in the following line is a StreamSubscription that is never cancelled, this could cause memory leaks:
Things like this and the other state should be cleaned up when dispose() is called.
The text was updated successfully, but these errors were encountered: