Skip to content

Fixes #1702: Fixed Memory Leak in MediaElement#1736

Merged
TheCodeTraveler merged 1 commit intoCommunityToolkit:mainfrom
marco-skizza:main
Mar 7, 2024
Merged

Fixes #1702: Fixed Memory Leak in MediaElement#1736
TheCodeTraveler merged 1 commit intoCommunityToolkit:mainfrom
marco-skizza:main

Conversation

@marco-skizza
Copy link
Copy Markdown
Contributor

Description of Change

Fixed Memory Leak in MediaElement.
The timer is now disposed as well.

Linked Issues

PR Checklist

Additional information

Tested on: WinUI, Android, iOS

My Issues hasn't been approved yet, but I thought I nevertheless share my findings with this PR.
I hope you can merge it, in order to improve memory management for people using the MediaElement.

P.S.:
As mentioned in the Issue, besides disposing the handler, I had to dispose the MediaElement itself as well to get rid of the Memory Leak:

        MyMediaElement.Handler?.DisconnectHandler();
        MyMediaElement.Dispose();

But I think this can be added to the docu+sample later on...

Many thanks!

@marco-skizza
Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree company="Kanton Luzern"

Copy link
Copy Markdown
Member

@pictos pictos left a comment

Choose a reason for hiding this comment

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

Good catch!

@TheCodeTraveler TheCodeTraveler enabled auto-merge (squash) March 7, 2024 21:05
@TheCodeTraveler TheCodeTraveler merged commit af42a4b into CommunityToolkit:main Mar 7, 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] MediaElement is not currently being Garbage Collected

3 participants