Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Navigating back from MediaElement and calling DisconnectHandler results in crash #1973

Open
sjorsmiltenburg opened this issue Jun 14, 2023 · 1 comment
Labels
bug Something isn't working. Breaky break. maui-compat

Comments

@sjorsmiltenburg
Copy link

sjorsmiltenburg commented Jun 14, 2023

Description

I have the mediaelement working on windows to play my video.
But when i navigate back and, as per the documentation, try to release the resources by calling
MyMediaElement.Handler?.DisconnectHandler();
during unload. It crashes with a Catastrophic Failure Exception.

I found multiple issues reporting this problem (like this one: CommunityToolkit/Maui#962), but all issues seem to have been closed as in "fixed". So I don't understand why I'm still seeing this behaviour with the latest version.
Or maybe the documentation is outdated and we no longer need to call the DisconnectHandler method??

I'm using

  • CommunityToolkit.Maui 5.2.0
  • CommunityToolkit.Maui.MediaElement 2.0.0

Stack Trace

Link to Reproduction Sample

a reproduction sample is here: https://github.com/sjorsmiltenburg/maui_bugs
if you press the button Bug5 you will see the crash on windows

Steps to Reproduce

  1. open repro sample
  2. click the bug 5 button
  3. navigate back

Expected Behavior

no crash

Actual Behavior

crash

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • Windows:
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:
  • MAUI Version:

Workaround

Don't call MyMediaElement.Handler?.DisconnectHandler();

Reproduction imagery

@sjorsmiltenburg sjorsmiltenburg added bug Something isn't working. Breaky break. maui-compat labels Jun 14, 2023
@sjorsmiltenburg
Copy link
Author

sjorsmiltenburg commented Jun 14, 2023

sorry, i seem to have opened this issue on the wrong repo. I've opened a new one on the maui repo: CommunityToolkit/Maui#1245
this one can be closed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working. Breaky break. maui-compat
Projects
None yet
Development

No branches or pull requests

1 participant