Skip to content

[Memory Usage]: Add dispose() method for freeing memory used by ui.Image objects #49

@okmanideep

Description

@okmanideep

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

0.3.0

What you'd like to happen

ScreenRecorderController.dispose() invokes Exporter.dispose() which internally calls dispose on each ui.Image objects being referred to Frame.image.dipose().

A class or method that receives an image object must call dispose on the handle when it is no longer needed.

Image | dart:ui | Documentation

Alternatives you've considered

Calls to .export() automatically disposes the Images. This might be ok, but it's a call between implicit vs explicit.

Implicit -> Good behaviour for all consumers
Explicit -> More control and clarity

Even in the case of implicit, it's better to give the option to dispose without needing to export

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions