/// <summary> /// When overridden in a derived class, executes the code required to free the handle. /// </summary> /// <returns> /// true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. In this case, it generates a ReleaseHandleFailed Managed Debugging Assistant. /// </returns> protected override bool ReleaseHandle() { if (!IsInvalid) { MonoUsbApi.FreeDeviceList(handle, 1); //Console.WriteLine("FreeDeviceList:{0}", handle); SetHandleAsInvalid(); } return(true); }