Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix other element's memory leaks due to ImageProvider cached. #592

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

andycall
Copy link
Member

@andycall andycall commented Apr 2, 2024

By default, Flutter caches the ImageProvider globally. However, these providers also hold strong references to WebF's elements.

This PR removes these strong references to ensure elements can be garbage collected freely, except for the ImageProviders.

return data;
}

static void _handleBitFitImageLoad(
Element element, int naturalWidth, int naturalHeight, int frameCount) {
if (frameCount > 1 && !element.renderStyle.target.isRepaintBoundary) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接使用以下code吧
element.isRepaintBoundary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants