Example #1
0
static void discard_SinkVChan_type (SinkVChan_type** sinkVChanPtr)
{
	SinkVChan_type* 	sinkVChan	= *sinkVChanPtr;
	char*				errMsg		= NULL;
	
	if (!sinkVChan) return;
	
	// disconnect Sink from Source if connected
	VChan_Disconnect((VChan_type*)sinkVChan);
	
	// release any data packets still in the VChan TSQ
	ReleaseAllDataPackets (sinkVChan, &errMsg); 
	
	// discard data packet types array
	OKfree(sinkVChan->dataTypes);
	
	// discard Sink VChan specific data 
	CmtDiscardTSQ(sinkVChan->tsqHndl);
	
	// discard base VChan data
	OKfree(sinkVChan->baseClass.name);
	
	OKfree(errMsg);
	OKfree(*sinkVChanPtr);
}
/* 程序退出时,清理占用的内存和垃圾 */
void cleanGarbage(void){
	pauseDataAcq();
	stopDataAcq();
	CmtDiscardTSQ(tsqHdl);
	CmtDiscardThreadPool(poolHandle);
	DiscardPanel(panelHdl);
}