Closed jangruenwaldt closed 5 months ago
Doesn't closing the client, automatically close this data stream as well? Also there's no close/disconnect method for StreamedResponse
class
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.