Skip to content

Calling dispose on a ui.Image should release native resources #57746

@dnfield

Description

@dnfield

Currently, ui.Image.dispose tries to clear the Dart wrapper, but does not release the underlying Skia resources until a GC is performed. It should be possible to do this more efficiently/quickly. See more discussion at #56482

A dispose method on a Dart object that allocates significant native resources should at least make an effort to dispose them. One challenge I'm seeing with this is that something else might still be referrring to the underlying SkImage, and I'm still trying to track down what that is or if we can do anything about it.

/cc @jason-simmons @chinmaygarde

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: imagesLoading, displaying, rendering imagesc: performanceRelates to speed or footprint issues (see "perf:" labels)engineflutter/engine related. See also e: labels.perf: memoryPerformance issues related to memory

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions