Merge pull request #227 from narspt/patch-23

fix occasional ambed crash when device fails init
This commit is contained in:
LX3JL 2023-03-01 18:29:42 +01:00 committed by GitHub
commit bd3fcee288
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,6 +55,15 @@ CUsb3xxxInterface::CUsb3xxxInterface(uint32 uiVid, uint32 uiPid, const char *szD
CUsb3xxxInterface::~CUsb3xxxInterface() CUsb3xxxInterface::~CUsb3xxxInterface()
{ {
// stop thread first
m_bStopThread = true;
if ( m_pThread != NULL )
{
m_pThread->join();
delete m_pThread;
m_pThread = NULL;
}
// delete m_SpeechQueues // delete m_SpeechQueues
for ( int i = 0; i < m_SpeechQueues.size(); i++ ) for ( int i = 0; i < m_SpeechQueues.size(); i++ )
{ {