From e24036169c4ab13b0901dd2218e313f5691b5fb9 Mon Sep 17 00:00:00 2001 From: peilixia Date: Fri, 23 Sep 2022 17:03:56 +0800 Subject: [PATCH] modify uselessAssignmentPtrArg Signed-off-by: peilixia --- base/src/thread_ex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/src/thread_ex.cpp b/base/src/thread_ex.cpp index 3fb2982..4811191 100644 --- a/base/src/thread_ex.cpp +++ b/base/src/thread_ex.cpp @@ -42,7 +42,6 @@ struct ThreadParam { std::string threadName = t->name; delete t; - t = nullptr; // set thread priority (void)setpriority(PRIO_PROCESS, 0, prio); @@ -82,6 +81,7 @@ bool CreatePThread(ThreadParam& para, size_t stackSize, pthread_t *threadId) pthread_t thread; int result = pthread_create(&thread, &attr, reinterpret_cast(para.startRoutine), para.args); pthread_attr_destroy(&attr); + para.args = nullptr; if (result != 0) { return false; -- Gitee