Other Parts Discussed in Thread: SYSBIOS
Tool/software: Code Composer Studio
Hello All,
I created a Queue to store the data coming from an SPI master device. So I dynamically created a queue variable to enque the data into the queue as shown below :
spiQueue *DataQueue; // Contains : elem, spiData
DataQueue = (spiQueue *)malloc( sizeof(spiQueue) ) ;
memset(DataQueue->spiData, 0, 264);
memcpy( DataQueue->spiData, data, dataLen );
Queue_enqueue(QueueHandle, &DataQueue->elem);
//free(DataQueue);
Now, when I try to free the DataQueue here, then the data becomes inaccessible later on. So my question is, is it not required to free the dynamically allocated DataQueue after enqeueuing it?
Also I believe I am getting an GAP_EVT_INSUFFICIENT_MEMORY issue due to not freeing this data. Could that be ?
Regards,
Shyam