When I create a new TASK and use CPP objects like this then exit the task code I get a memory leak:
Code: Select all
void vATaskFunction( void *pvParameters )
{
string s = "hello";
vector<int> v;
vTaskDelete(NULL);
}
Code: Select all
void vATaskFunction( void *pvParameters )
{
string* s = new string("hello");
vector<int>* v = new vector<int>();
delete s;
delete v;
vTaskDelete(NULL);
}
Code: Select all
void helper( void *pvParameters )
{
string s = "hello";
vector<int> v;
}
void vATaskFunction( void *pvParameters )
{
helper(pvParameters);
vTaskDelete(NULL);
}
Every time I create a new task, I was getting a massive memory leak and later I found out it was caused by this weird behavior.