DarshanGowda0 / GeoFlutterFire

:fire:GeoFlutterFire:fire: is an open-source library that allows you to store and query firestore documents based on their geographic location.
https://youtu.be/MYHVyl-juUk
MIT License
305 stars 261 forks source link

Substreams of surrounding 9 geohashes do not get disposed #130

Closed justChris closed 1 year ago

justChris commented 3 years ago

When I am listening to the within stream, the plugin creates 9 streams for the nearby geohashes. When I dispose the stream to the within subscription, the 9 substreams should also be disposed, but this is not happening.

Could this not lead to memory leaks??

justChris commented 3 years ago

I think I figured out why this is.

I am using the resulting stream in a behaviorSubject which is a broadcast controller. Since the resulting stream is return as a broadcast stream as well, the source streams are not going to be closed when I cancel the stream subscription of that behaviorSubject for some reason.

The solution for me was to simply removing the asBroadcastStream() in file collection.dart.

0radek commented 3 years ago

This still happens for me. Any solution to this?