Open ningzhihui1997 opened 2 years ago
1. if ((RT_NULL == attr) || (RT_NULL == attr->cb_mem)) { thread_cb = rt_malloc(sizeof(thread_cb_t)); if (RT_NULL == thread_cb) return RT_NULL; rt_memset(thread_cb, 0, sizeof(thread_cb_t)); thread_cb->flags |= MALLOC_CB; } 2. if ((RT_NULL == attr) || (osPriorityNone == attr->priority)) { thread_cb->prio = osPriorityNormal; } else { if ((attr->priority < osPriorityIdle) || (attr->priority > osPriorityISR)) return RT_NULL;
thread_cb->prio = attr->priority; }
此处 return 未释放上边的thread_cb
1. if ((RT_NULL == attr) || (RT_NULL == attr->cb_mem)) { thread_cb = rt_malloc(sizeof(thread_cb_t)); if (RT_NULL == thread_cb) return RT_NULL; rt_memset(thread_cb, 0, sizeof(thread_cb_t)); thread_cb->flags |= MALLOC_CB; } 2. if ((RT_NULL == attr) || (osPriorityNone == attr->priority)) { thread_cb->prio = osPriorityNormal; } else { if ((attr->priority < osPriorityIdle) || (attr->priority > osPriorityISR)) return RT_NULL;
此处 return 未释放上边的thread_cb