From ad52cee578ca65531366d04ab36974aeb6aa1d03 Mon Sep 17 00:00:00 2001 From: cgm <2958580318@qq.com> Date: Mon, 24 Jan 2022 09:31:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddata=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E9=87=8A=E6=94=BE=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Util/util.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Util/util.cpp b/src/Util/util.cpp index d9cbe8c..3ae7072 100644 --- a/src/Util/util.cpp +++ b/src/Util/util.cpp @@ -484,8 +484,8 @@ string getThreadName() { char threadName[MAX_PATH]; size_t numCharsConverted; errno_t charResult = wcstombs_s(&numCharsConverted, threadName, data, MAX_PATH - 1); + LocalFree(data); if (charResult == 0) { - LocalFree(data); std::ostringstream ss; ss << threadName; return ss.str(); @@ -493,6 +493,7 @@ string getThreadName() { return to_string((uint64_t) GetCurrentThreadId()); } } else { + LocalFree(data); return to_string((uint64_t) GetCurrentThreadId()); } } -- Gitee