MixedReality-WebRTC icon indicating copy to clipboard operation
MixedReality-WebRTC copied to clipboard

PeerConnection.RemoveDataChannel throws Handle is not initialized

Open wenjunche opened this issue 4 years ago • 0 comments

(First, Thanks for all your work on the great library!)

Describe the bug

Using .NET 4.7.2 in a simple console app, with one PeerConnetion and one DataChannel. Calling PeerConnection.RemoveDataChannel throws the following exception:

System.InvalidOperationException HResult=0x80131509 Message=Handle is not initialized. Source=mscorlib StackTrace: at System.Runtime.InteropServices.GCHandle.FromIntPtr(IntPtr value) at Microsoft.MixedReality.WebRTC.DataChannel.DestroyNative() at Microsoft.MixedReality.WebRTC.PeerConnection.RemoveDataChannel(DataChannel dataChannel)

PeerConnection.DataChannelRemoved, if installed, is being called before the exception is thrown.

Expected behavior DataChannel is closed.

Environment MR-WebRTC: Latest stable 2.0.2 Platform: Windows 10.0.19042 Build 199042, .NET 4.7.2 Architecture: x86 Target device: Windows Desktop

Thanks

wenjunche avatar Jul 19 '21 21:07 wenjunche