this problem occurs when i delete old thread(needless) and create new thread.
i wanted to additional features, so i create a new thread.
but my code is out of memory.
so i thought deleting the deprecated threads and creating a new thread would solve the problem.
but new thread address does not enter an address previously deleted.
assign to next address. so, when creating use to ‘new’ operator, out of memory.
//////////////////////////////////////////
HOST *pgHost = new HOST();
HOST::HOST() : :
SerialPipe(HOST_TX, HOST_RX, 115200, gHostRxBuff, sizeof(gHostRxBuff), 0, gHostTxBuff, sizeof(gHostTxBuff)), _daemon(NULL)
{
pgHost->setDataMode();
pgHost->setReport(false);
_debug_trace_on = false;
mutex_init();
_daemon = new Thread(osPriorityNormal, OS_STACK_SIZE * 2, NULL, “host”);
_daemon->start(callback(this, &HOST::daemon));
setWdgFlag(etrHOST);
rmc_timestamp = 0;
}
////////////////////////////////
like the example above, i create a thread.
Delete unnecessary threads through ‘if’ operator, and then create new thread.