Ensure proper closure of the heartbeat thread on reopen

This commit is contained in:
Paul Hollinsky
2020-09-01 15:52:41 -04:00
parent c48995520f
commit 046e2bae9d
2 changed files with 30 additions and 18 deletions
+1 -8
View File
@@ -27,13 +27,7 @@ namespace icsneo {
class Device {
public:
virtual ~Device() {
if(isMessagePollingEnabled())
disableMessagePolling();
close();
if(heartbeatThread.joinable())
heartbeatThread.join();
}
virtual ~Device();
static std::string SerialNumToString(uint32_t serial);
static uint32_t SerialStringToNum(const std::string& serial);
@@ -103,7 +97,6 @@ protected:
bool online = false;
int messagePollingCallbackID = 0;
int internalHandlerCallbackID = 0;
int messageReceivedCallbackID = 0;
device_eventhandler_t report;
// START Initialization Functions