From 6800b7591c050208251a3694ce2ea6f6bc116c5c Mon Sep 17 00:00:00 2001 From: Greg Foss Date: Fri, 8 May 2020 14:43:12 -0400 Subject: [PATCH] Adding check to data sync thread send to make sure thread is running before attempting to send --- bfs/src/comms/DataSyncThread.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bfs/src/comms/DataSyncThread.cpp b/bfs/src/comms/DataSyncThread.cpp index d1d5d30..1083a8c 100644 --- a/bfs/src/comms/DataSyncThread.cpp +++ b/bfs/src/comms/DataSyncThread.cpp @@ -302,6 +302,9 @@ bool DataSyncThread::areIncomingAttributesAvailable() bool DataSyncThread::sendAttribute(Attribute attrib) { + if (!threadRunning) + return true; + // two extra bytes, one for command 0x00 and one for length: int streamLength = attrib.getLength() + ATTRIB_KEY_SIZE + 2; char *bytes = new char[streamLength];