aboutsummaryrefslogtreecommitdiff
path: root/device.cc
diff options
context:
space:
mode:
Diffstat (limited to 'device.cc')
-rw-r--r--device.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/device.cc b/device.cc
index 6660276..a420a64 100644
--- a/device.cc
+++ b/device.cc
@@ -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() {