Skip to content

Memory leak on TintedImageBehavior fix#1625

Merged
bijington merged 5 commits intoCommunityToolkit:mainfrom
Marioo1357:IconTintBevavior-Fix
Feb 14, 2024
Merged

Memory leak on TintedImageBehavior fix#1625
bijington merged 5 commits intoCommunityToolkit:mainfrom
Marioo1357:IconTintBevavior-Fix

Conversation

@Marioo1357
Copy link
Copy Markdown
Contributor

@Marioo1357 Marioo1357 commented Dec 28, 2023

We subscribe to OnElementPropertyChanged only once - OnAttached - instead of each time the TintColor is changed

Every time when color was applied, the void was added to event handler. It causes that every next ImageSource change, invoked heavy color logic multiple times

Description of Change

Move dispose and subscibe logic right place in ImageTintBehavior

Linked Issues

PR Checklist

Additional information

Every time when color was applied, the void was added to event handler.
It causes that every next ImageSource change, invoked heavy color logic multiple times
@Marioo1357
Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree

Copy link
Copy Markdown
Contributor

@VladislavAntonyuk VladislavAntonyuk left a comment

Choose a reason for hiding this comment

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

Thank you!
Just add some explanation: we subscribe to OnElementPropertyChanged only once - OnAttached - instead of each time the TintColor is changed

@Marioo1357 Marioo1357 closed this Dec 29, 2023
@Marioo1357 Marioo1357 reopened this Dec 29, 2023
@Marioo1357
Copy link
Copy Markdown
Contributor Author

PR has:

  • no test because the tests on native code are not supported
  • no any additional samples, because current is enough
  • no documentation updated, because there is no change in any behaviour

@bijington bijington enabled auto-merge (squash) February 13, 2024 19:47
@bijington bijington merged commit cc62c6f into CommunityToolkit:main Feb 14, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] IconTintColorBehavior huge memory leak and app freeze on Android

5 participants