Baseflow / Baseflow/screenrecorder

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

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
77
Forks
35
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [x] 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](https://api.flutter.dev/flutter/dart-ui/Image-class.html)

### Alternatives you've considered

Calls to `.export()` automatically disposes the `Image`s. 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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.