7mada123 / disposable_cached_images

MIT License
9 stars 4 forks source link

_usedImageProvider leaks ImageInfoData #14

Open spauldhaliwal opened 3 weeks ago

spauldhaliwal commented 3 weeks ago

_usedImageProvider keeps references to ImageInfoData causing a substantial memory leak.

It can be fixed by adding void remove(final String key) => usedImageProvidersList.remove(key);

to _UsedImageProviders()

and calling

ref.read(_usedImageProvider).remove(key);

inside the dispose method of BaseImageProvider

I'm still going through the codebase trying to understand all the ins and outs, so I wouldn't be comfortable making a pull request just yet. I can do that at a later date if you'd like.