Cannot access a disposed object. Object name: 'Org.Videolan.Libvlc.AWindow'
Summary
Using Xamarin.Android starting from VideoLAN.LibVLC.Android version 3.1.2 and LibVLCSharp version 3.1.0 getting a bug with AWindow disposed object.
Minimal project and steps to reproduce
Start player. Put it into sleep. Try to resume.
From time to time on resume exception is thrown.
What is the current bug behavior?
Throws exception:
System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Org.Videolan.Libvlc.AWindow'.
What is the expected correct behavior?
Resume player normally
Relevant logs and/or screenshots
Log from debug output
08-07 13:14:55.021 E/AppCenterCrashes( 4029): Unhandled Exception from source=AppDomain
08-07 13:14:55.021 E/AppCenterCrashes( 4029): System.ObjectDisposedException: Cannot access a disposed object.
08-07 13:14:55.021 E/AppCenterCrashes( 4029): Object name: 'Org.Videolan.Libvlc.AWindow'.
08-07 13:14:55.021 E/AppCenterCrashes( 4029): at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <286213b9e14c442ba8d8d94cc9dbec8e>:0
08-07 13:14:55.021 E/AppCenterCrashes( 4029): at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <286213b9e14c442ba8d8d94cc9dbec8e>:0
08-07 13:14:55.021 E/AppCenterCrashes( 4029): at Org.Videolan.Libvlc.AWindow.RemoveCallback (Org.Videolan.Libvlc.IVLCVoutCallback p0) [0x00036] in <5d91f7f6b5984e8791324c47b9a0b2ec>:0
08-07 13:14:55.021 E/AppCenterCrashes( 4029): at LibVLCSharp.Platforms.Android.VideoView.Detach () [0x0000a] in <213234891dfb4f49be24e5d82c437f85>:0
08-07 13:14:55.021 E/AppCenterCrashes( 4029): at LibVLCSharp.Platforms.Android.VideoView.Dispose (System.Boolean disposing) [0x00007] in <213234891dfb4f49be24e5d82c437f85>:0
08-07 13:14:55.021 E/AppCenterCrashes( 4029): at Java.Lang.Object.Finalize () [0x00048] in <95d915721ad748108ff096dce8f8f32c>:0
Log from appcenter.ms
JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self)
JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters)
AWindow.RemoveCallback (Org.Videolan.Libvlc.IVLCVoutCallback p0)
VideoView.Detach ()
VideoView.Dispose (System.Boolean disposing)
Object.Finalize ()
Environment
- OS: Android
- Version 7.0, 9.0
- Device: Samsung Galaxy S6, Sony Android TV, Android Emulator
- LibVLC version and architecture 3.1.2, x64
- LibVLCSharp version 3.1.0