flutter_svg_provider
flutter_svg_provider copied to clipboard
Memory leaks
Hi!
You use vg.loadPicture
in the _loadAsync
method and you must call Picture.dispose
when you are done with the pictureInfo.picture
. But I don't see in your code any mention of disposing.
An Image
widget using your Svg
ImageProvider gets from the provider an ImageInfo
with the ui.Image
taken from pictureInfo.picture.toImage
, and when the Image widget is done, it calls ui.Image.dispose
but not Picture.dispose
, so all resources of the Picture
used for rasterizing the image stay in memory.