Commit 3e8586f
Fix Media Element fails to load a URL (#2265)
Enhance Dispose method for better resource management
Updated the Dispose method in MauiMediaElement.windows.cs to include:
- Pausing the media player before disposal.
- Explicitly disposing of MediaSource if used.
- Setting the media player's source to null.
- Disposing of the media player.
- Setting the media player element's media player to null.
These changes ensure proper release of resources, preventing memory leaks.
Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>1 parent b4183e1 commit 3e8586f
File tree
1 file changed
+10
-0
lines changed- src/CommunityToolkit.Maui.MediaElement/Views
1 file changed
+10
-0
lines changedLines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
142 | 151 | | |
| 152 | + | |
143 | 153 | | |
144 | 154 | | |
145 | 155 | | |
| |||
0 commit comments