cTumkwsaSink::~cTumkwsaSink() { //TODO: properly terminate ATK threads... if (arec != NULL) { arec->SendMessage("terminate()"); arec->Join(); } smileMutexLock(terminatedMtx); terminated = TRUE; smileMutexUnlock(terminatedMtx); smileThreadJoin(ATKresThread); if(arec!=NULL) delete arec; if(rman!=NULL) delete rman; if(hset!=NULL) delete hset; if(dict!=NULL) delete dict; if(gram!=NULL) delete gram; if(feChan!=NULL) delete feChan; if(ansChan!=NULL) delete ansChan; if (queue != NULL) delete queue; smileMutexDestroy(terminatedMtx); }
cTumkwsjSink::~cTumkwsjSink() { smileMutexLock(dataFlgMtx); terminated = TRUE; smileCondSignal( tickCond ); smileMutexUnlock(dataFlgMtx); if (decoderThread != NULL) smileThreadJoin(decoderThread); /* release all */ j_recog_free(recog); //if (logfile) fclose(fp); smileMutexDestroy(terminatedMtx); smileMutexDestroy(dataFlgMtx); smileCondDestroy(tickCond); }
cSmileLogger::~cSmileLogger() { smileMutexLock(logmsgMtx); if (msg != NULL) free(msg); closeLogfile(); if (logfile != NULL) free(logfile); smileMutexUnlock(logmsgMtx); smileMutexDestroy(logmsgMtx); }