We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3bab01 commit d1d0a89Copy full SHA for d1d0a89
src/LibVLCSharp/Shared/MediaPlayer.cs
@@ -631,20 +631,23 @@ public MediaPlayer(Media media)
631
/// </summary>
632
public Media? Media
633
{
634
- get
635
- {
636
- return _media;
637
- }
+ get => _media;
638
set
639
640
- if(_media?.NativeReference != IntPtr.Zero)
+ if(_media != null)
641
642
- _media?.Dispose();
+ _media.Dispose();
643
_media = null;
644
}
645
646
_media = value;
647
- Native.LibVLCMediaPlayerSetMedia(NativeReference, value?.NativeReference ?? IntPtr.Zero);
+
+ {
+ _media.Retain();
648
+ }
649
650
+ Native.LibVLCMediaPlayerSetMedia(NativeReference, _media?.NativeReference ?? IntPtr.Zero);
651
652
653
0 commit comments