File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ platform_thread_t *platform_thread_init( const char *name,
2828 thread -> thread = rt_thread_create ((const char * )name ,
2929 entry , param ,
3030 stack_size , priority , tick );
31-
31+
3232 if (thread -> thread == RT_NULL )
3333 {
34- return RT_NULL ;
34+ return RT_NULL ;
3535 }
3636 else
3737 {
38- return thread ;
38+ return thread ;
3939 }
4040
4141}
@@ -49,7 +49,6 @@ void platform_thread_startup(platform_thread_t* thread)
4949void platform_thread_stop (platform_thread_t * thread )
5050{
5151 rt_thread_suspend (thread -> thread );
52-
5352}
5453
5554void platform_thread_start (platform_thread_t * thread )
@@ -59,8 +58,9 @@ void platform_thread_start(platform_thread_t* thread)
5958
6059void platform_thread_destroy (platform_thread_t * thread )
6160{
62- rt_thread_delete (thread -> thread );
63- platform_memory_free (thread );
61+ if (thread ) {
62+ rt_thread_t thread_handle = thread -> thread ;
63+ platform_memory_free (thread );
64+ rt_thread_delete (thread_handle );
65+ }
6466}
65-
66-
You can’t perform that action at this time.
0 commit comments