flutter_svg_provider icon indicating copy to clipboard operation
flutter_svg_provider copied to clipboard

Memory leaks

Open darkstarx opened this issue 8 months ago • 2 comments

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.

darkstarx avatar May 31 '24 10:05 darkstarx