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

Memory leak when playing multiple video's after each other without closing the app. #40

Open
JohannesKauffmann opened this issue Dec 23, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@JohannesKauffmann
Copy link
Collaborator

The app uses about twice or three times as much memory after playing multiple video's in succession without closing the app.
After some research, there are multiple things we can do:

  • Unsubscribe from event handlers
  • Dispose the Media as per the LibVLCSharp.UWP sample
  • Stop using MVVM Light as it is no longer maintained and has leaks as well.

It might also have something to do with this issue.

@JohannesKauffmann JohannesKauffmann added the bug Something isn't working label Dec 23, 2020
JohannesKauffmann added a commit that referenced this issue Dec 23, 2020
Related issue is #40.

VideoPlayerPageViewModel:
- chg: Instead of lambda's, event handlers are now used for all events,
including timers. The fileNameOverlayTimer has been moved to the top and
made readonly, so it is only initialized once. Also, some comments have
been split over multiple lines.
- fix: The fileNameOverlayTimer is now only once instead of every 5 seconds.

Views/VideoPlayerPage.xaml.cs:
- chg: Unsubscribe from events using event handlers instead of lambda's.
Some comments have been split over multiple lines.
JohannesKauffmann added a commit that referenced this issue Dec 23, 2020
Related issue is #40.

App.xaml.cs:
- add: Global UI dispatcher property, so every class can access the UI conventiently.

VideoPlayerPageViewModel.cs:
- rem: Unneeded using system.diagnostics.

VideoPlayerPage.xaml.cs:
- chg: Dispose the media after playing it by wrapping it in a using. This follows the
official LibVLCSharp UWP sample. Replaced lengthy dispatcher calls with App.Current.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant