Skip to content

Commit e759489

Browse files
committed
Merge branch 'memory_free_issue'
2 parents b441ab9 + c869ebb commit e759489

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

mqttclient/mqttclient.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,6 @@ static void mqtt_yield_thread(void *arg)
957957
if(NULL != thread_to_be_destoried)
958958
{
959959
platform_thread_destroy(thread_to_be_destoried);
960-
platform_memory_free(thread_to_be_destoried);
961960
thread_to_be_destoried = NULL;
962961
}
963962
}

platform/RT-Thread/platform_thread.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ void platform_thread_start(platform_thread_t* thread)
5959

6060
void platform_thread_destroy(platform_thread_t* thread)
6161
{
62+
rt_thread_delete(thread->thread);
6263
platform_memory_free(thread);
6364
}
6465

platform/TencentOS-tiny/platform_thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ void platform_thread_destroy(platform_thread_t* thread)
5959
{
6060
if (NULL != thread)
6161
tos_task_destroy(&(thread->thread));
62+
platform_memory_free(thread->thread.stk_base);
6263
platform_memory_free(&(thread->thread));
63-
platform_memory_free(&(thread->thread.stk_size));
6464
}
6565

6666

platform/linux/platform_thread.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ void platform_thread_start(platform_thread_t* thread)
5454

5555
void platform_thread_destroy(platform_thread_t* thread)
5656
{
57-
if (NULL != thread)
57+
if (NULL != thread) {
5858
pthread_detach(thread->thread);
59+
platform_memory_free(thread);
60+
}
5961
}
6062

6163

0 commit comments

Comments
 (0)