diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2016-10-14 12:17:50 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2016-10-19 16:34:10 +0200 |
commit | 18f427f6bf50f64ba3b4b2c1c1dd168f0c8fdb76 (patch) | |
tree | c1b46f98aa5b3c13cc4f2799e53201c6762ec804 /device.cc | |
parent | 21b98b2174cc13b1fc99d4f1c2155e170465a37f (diff) | |
download | libnitrokey-18f427f6bf50f64ba3b4b2c1c1dd168f0c8fdb76.tar.gz libnitrokey-18f427f6bf50f64ba3b4b2c1c1dd168f0c8fdb76.tar.bz2 |
Fixed bug with not releasing device on disconnect
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'device.cc')
-rw-r--r-- | device.cc | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -21,8 +21,10 @@ Device::Device() bool Device::disconnect() { Log::instance()(__PRETTY_FUNCTION__, Loglevel::DEBUG_L2); - hid_exit(); + if(mp_devhandle== nullptr) return false; + hid_close(mp_devhandle); mp_devhandle = NULL; + hid_exit(); return true; } bool Device::connect() { |