public override void CreateGenerics() { Generics.Clear(); GenericCallTypes.Clear(); foreach (TypeSig t in AssociatedTypes) { if (!Generics.ContainsKey(t.ScopeType.MDToken.Raw)) { Generics.Add(t.ScopeType.MDToken.Raw, new GenericParamUser( (ushort)(TargetType.GenericParameters.Count + Generics.Count()), GenericParamAttributes.NoSpecialConstraint, GenericParamName)); //gen name GenericCallTypes.Add(t); } } }
public void Dispose() { if (Generics != null) { foreach (KeyValuePair <string, HIDDevice> entry in Generics) { entry.Value.Dispose(); } Generics.Clear(); } Debug.Log("Try to remove Drivers"); if (__drivers != null) { __drivers.Clear(); } }
void IDisposable.Dispose() { if (hidmanager != IntPtr.Zero) { //throw exception don't know why // if(RunLoop!=IntPtr.Zero && InputLoopMode!=IntPtr.Zero) // Native.IOHIDDeviceUnscheduleWithRunLoop(hidmanager, // RunLoop, InputLoopMode); Debug.Log("Try to remove OSXHIDInterface registers"); Native.IOHIDManagerRegisterDeviceMatchingCallback( hidmanager, IntPtr.Zero, IntPtr.Zero); Native.IOHIDManagerRegisterDeviceRemovalCallback( hidmanager, IntPtr.Zero, IntPtr.Zero); Debug.Log("Try to release HIDManager"); Native.CFRelease(hidmanager); } lock (syncRoot){ if (Generics != null) { foreach (KeyValuePair <string, HIDDevice> entry in Generics) { entry.Value.Dispose(); } Generics.Clear(); } Debug.Log("Try to remove Drivers"); if (__drivers != null) { __drivers.Clear(); } } }