From 408745abb602e0bdc535889b6f67c91ac856b0db 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..d1a8bc7 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; + // two extra bytes, one for command 0x00 and one for length: int streamLength = attrib.getLength() + ATTRIB_KEY_SIZE + 2; char *bytes = new char[streamLength];