On device prevent closing an already closed handle, as when debugging under Windows this raises an exception.

This commit is contained in:
2018-12-01 19:31:04 +00:00
parent ade74a57f5
commit 3a0b9b634f
2 changed files with 3 additions and 1 deletions

View File

@@ -64,6 +64,8 @@ namespace DiscImageChef.Devices
FreeBSD.Extern.cam_close_device((IntPtr)FileHandle); FreeBSD.Extern.cam_close_device((IntPtr)FileHandle);
break; break;
} }
FileHandle = null;
} }
} }
} }

View File

@@ -61,7 +61,7 @@ namespace DiscImageChef.Devices
/// Gets the file handle representing this device /// Gets the file handle representing this device
/// </summary> /// </summary>
/// <value>The file handle</value> /// <value>The file handle</value>
public object FileHandle { get; } public object FileHandle { get; private set; }
/// <summary> /// <summary>
/// Gets or sets the standard timeout for commands sent to this device /// Gets or sets the standard timeout for commands sent to this device