Skip to content

Commit 4423cd1

Browse files
committed
Prevent crash when removing processor
1 parent 4cbc1fa commit 4423cd1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Source/Plugins/IntanRecordingController/USBThread.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,12 @@ void USBThread::startAcquisition(int nBytes)
5151
void USBThread::stopAcquisition()
5252
{
5353
std::cout << "Stopping usb thread" << std::endl;
54-
if (!stopThread(1000))
54+
if (isThreadRunning())
5555
{
56-
std::cerr << "USB Thread could not stop cleanly. Force quitting it" << std::endl;
56+
if (!stopThread(1000))
57+
{
58+
std::cerr << "USB Thread could not stop cleanly. Force quitting it" << std::endl;
59+
}
5760
}
5861
}
5962

0 commit comments

Comments
 (0)